A058184 "Real rabbits": a(n) = Re(c(n)) where complex c(n) = a(n) + i*b(n) and c(0) = i, c(1) = -i, c(n) = c(n-1) + i*c(n-2).
0, 0, -1, 0, 1, 2, 4, 6, 7, 6, 1, -10, -28, -52, -77, -92, -79, -14, 128, 362, 675, 1002, 1201, 1038, 200, -1640, -4681, -8760, -13039, -15678, -13636, -2834, 21007, 60526, 113681, 169670, 204652, 179108, 39883, -269012, -782559, -1475214, -2207752, -2671278
Offset: 0
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (2,-1,0,-1).
Crossrefs
Cf. A014291.
Programs
-
Maple
a:= n-> (Matrix([[0,-1,0,0]]). Matrix([[2,1,0,0], [ -1,0,1,0], [0,0,0,1], [ -1,0,0,0]])^n)[1,4]: seq (a (n), n=0..50); # Alois P. Heinz, Sep 24 2008
-
Mathematica
CoefficientList[Series[(2x^3-x^2)/(1-2x+x^2+x^4),{x,0,50}],x] (* Harvey P. Dale, Apr 03 2011 *)
-
PARI
a(n)=([0,1,0,0; 0,0,1,0; 0,0,0,1; -1,0,-1,2]^n*[0;0;-1;0])[1,1] \\ Charles R Greathouse IV, Jun 16 2015
Formula
a(n) = a(n-1)-A014291(n-2) = 2*a(n-1)-a(n-2)-a(n-4).
G.f.: (2*x^3-x^2)/(1-2*x+x^2+x^4). - Alois P. Heinz, Sep 24 2008