|
|
A166012
|
|
a(n) = 2*(A000045(n)-(n mod 2)) + 1 + (n mod 2).
|
|
2
|
|
|
1, 2, 3, 4, 7, 10, 17, 26, 43, 68, 111, 178, 289, 466, 755, 1220, 1975, 3194, 5169, 8362, 13531, 21892, 35423, 57314, 92737, 150050, 242787, 392836, 635623, 1028458, 1664081, 2692538, 4356619, 7049156, 11405775, 18454930, 29860705, 48315634, 78176339
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,2
|
|
COMMENTS
|
This is an auxiliary sequence for computing A138606.
|
|
LINKS
|
|
|
FORMULA
|
If n mod 2 = 0 then a(n) = a(n-1) + a(n-2), else a(n) = a(n-1) + a(n-2) - 1.
a(n) = 2*Fibonacci(n) + (1+(-1)^n)/2.
a(n) = 2*Fibonacci(n) + [(n+1)mod 2]. - Gary Detlefs, Dec 29 2010
G.f.: (1 + x - x^2 - 2*x^3)/((1 - x^2)*(1 - x - x^2)). - Ilya Gutkovskiy, Apr 22 2016
a(n) = a(n-1)+2*a(n-2)-a(n-3)-a(n-4) for n>3.
a(n) = (1/2+(-1)^n/2-(2*((1/2*(1-sqrt(5)))^n-(1/2*(1+sqrt(5)))^n))/sqrt(5)).
(End)
|
|
MATHEMATICA
|
Table[2*Fibonacci[n] + (1 + (-1)^n)/2, {n, 0, 100}] (* G. C. Greubel, Apr 21 2016 *)
LinearRecurrence[{1, 2, -1, -1}, {1, 2, 3, 4}, 40] (* Harvey P. Dale, May 01 2018 *)
|
|
PROG
|
(MIT Scheme:) (define (A166012 n) (+ 1 (modulo n 2) (* 2 (- (A000045 n) (modulo n 2)))))
(PARI) Vec((1+x-x^2-2*x^3)/((1-x)*(1+x)*(1-x-x^2)) + O(x^50)) \\ Colin Barker, Apr 22 2016
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|