OFFSET
0,2
LINKS
Danny Rorabaugh, Table of n, a(n) for n = 0..4000
Index entries for linear recurrences with constant coefficients, signature (1,2,-1,-1).
FORMULA
For n >= 5, a(n) = a(n-1) + 2a(n-2) - a(n-3) - a(n-4). - Charles R Greathouse IV, Oct 14 2010
a(n) = 3*Fibonacci(n-1) + Fibonacci(n-2) + (n mod 2), n>0. - Gary Detlefs, Dec 29 2010
G.f.: (-x+x^2+x^3+x^4-1) / ((1-x)*(1+x)*(x^2+x-1)). - R. J. Mathar, Jan 06 2011
a(2k) = A000032(2k) = A169985(2k) and a(2k+1) = A000032(2k+1)+1 = A169985(2k+1)+1, for k>0. - Danny Rorabaugh, Apr 15 2015
MATHEMATICA
Ceiling[GoldenRatio^Range[0, 40]] (* or *) Join[{1}, LinearRecurrence[{1, 2, -1, -1}, {2, 3, 5, 7}, 40]] (* Harvey P. Dale, Nov 12 2014 *)
PROG
(Magma) [1] cat [3*Fibonacci(n-1) + Fibonacci(n-2)+ n mod 2: n in [1..40]]; // Vincenzo Librandi, Apr 16 2015
(Sage) [ceil(golden_ratio^n) for n in range(37)] # Danny Rorabaugh, Apr 16 2015
(PARI) a(n)=if(n, 3*fibonacci(n-1) + fibonacci(n-2) + n%2, 1) \\ Charles R Greathouse IV, Apr 16 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, Sep 26 2010
STATUS
approved