Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
A122876
a(0)=1, a(1)=1, a(2)=2, a(n) = a(n-1) - a(n-2) for n>2.
2
1, 1, 2, 1, -1, -2, -1, 1, 2, 1, -1, -2, -1, 1, 2, 1, -1, -2, -1, 1, 2, 1, -1, -2, -1, 1, 2, 1, -1, -2, -1, 1, 2, 1, -1, -2, -1, 1, 2, 1, -1, -2, -1, 1, 2, 1, -1, -2, -1, 1, 2, 1, -1, -2, -1, 1, 2, 1, -1, -2, -1, 1, 2, 1, -1, -2, -1, 1, 2, 1, -1, -2, -1, 1, 2, 1, -1, -2, -1
OFFSET
0,3
COMMENTS
Essentially the same as A057079, A087204 and A100051.
FORMULA
a(n) = Sum_{k=0..floor(n/2)} (-2)^k*A055830(n-k,k).
G.f.: (1+2*x^2)/(1-x+x^2).
MATHEMATICA
LinearRecurrence[{1, -1}, {1, 1, 2}, 50] (* G. C. Greubel, May 03 2017; corrected by Georg Fischer, Apr 02 2019 *)
(* or *) CoefficientList[Series[(1 + 2*x^2)/(1 - x + x^2), {x, 0, 50}], x] (* G. C. Greubel, May 03 2017 *)
PROG
(PARI) my(x='x+O('x^50)); Vec((1+2*x^2)/(1-x+x^2)) \\ G. C. Greubel, May 03 2017
CROSSREFS
KEYWORD
sign,easy
AUTHOR
Philippe Deléham, Oct 24 2006
STATUS
approved