OFFSET
0,2
COMMENTS
Row sums of A127967.
The sequence beginning 1,1,2,2,4,... with g.f. x/(1-x-x^2) + 1/(1-x^2) has general term a(n) = F(n) + (1+(-1)^n)/2.
LINKS
Colin Barker, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (1,2,-1,-1).
FORMULA
G.f.: 1 / (1 - x - x^2) + x / (1 - x^2).
G.f.: (1 + x - 2*x^2 - x^3) / ((1 - x)*(1 + x)*(1 - x - x^2)).
From Colin Barker, Jul 12 2017: (Start)
a(n) = (5 - 5*(-1)^n + 2^(-n)*sqrt(5)*(-(1-sqrt(5))^(1+n) + (1+sqrt(5))^(1+n))) / 10.
a(n) = a(n-1) + 2*a(n-2) - a(n-3) - a(n-4) for n>3.
(End)
MATHEMATICA
LinearRecurrence[{1, 2, -1, -1}, {1, 2, 2, 4}, 40] (* Harvey P. Dale, Jun 19 2013 *)
PROG
(PARI) Vec((1+x-2*x^2-x^3)/((1-x)*(1+x)*(1-x-x^2)) + O(x^50)) \\ Colin Barker, Jul 12 2017
(Magma) I:=[1, 2, 2, 4]; [n le 4 select I[n] else Self(n-1) +2*Self(n-2) - Self(n-3) -Self(n-4): n in [1..30]]; // G. C. Greubel, May 04 2018
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Paul Barry, Feb 09 2007
STATUS
approved