cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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.

Original entry on oeis.org

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

Views

Author

Giovanni Teofilatto, Mar 22 2010

Keywords

Programs

  • 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 *)

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]

Extensions

a(44) corrected by R. J. Mathar, Apr 14 2010
Precise definition from R. J. Mathar, Aug 23 2010