[go: up one dir, main page]

login
A174562
a(1)=2, a(2)=3, then a(n)=a(n-1)+a(n-2) if n odd, a(n)=a(n-1)-a(n-2) if n even.
2
2, 3, 5, 2, 7, 5, 12, 7, 19, 12, 31, 19, 50, 31, 81, 50, 131, 81, 212, 131, 343, 212, 555, 343, 898, 555, 1453, 898, 2351, 1453, 3804, 2351, 6155, 3804, 9959, 6155, 16114, 9959, 26073, 16114, 42187, 26073, 68260, 42187, 110447, 68260, 178707, 110447
OFFSET
1,1
FORMULA
a(n)= a(n-2) +a(n-4). G.f.: x*(-2-3*x-3*x^2+x^3)/(-1+x^2+x^4). a(2n+1) = A001060(n). a(2n) = A013655(n-1). [From R. J. Mathar, Apr 14 2010]
MATHEMATICA
nxt[{n_, a_, b_}]:={n+1, b, If[EvenQ[n], b-a, b+a]}; Transpose[ NestList[ nxt, {1, 2, 3}, 50]][[2]] (* or *) LinearRecurrence[{0, 1, 0, 1}, {2, 3, 5, 2}, 51] (* Harvey P. Dale, Jan 06 2012 *)
CROSSREFS
Sequence in context: A096062 A176195 A231233 * A224382 A069227 A117368
KEYWORD
nonn,easy
AUTHOR
Giovanni Teofilatto, Mar 22 2010
EXTENSIONS
a(44) corrected by R. J. Mathar, Apr 14 2010
Precise definition from R. J. Mathar, Aug 23 2010
STATUS
approved