A014292 a(n) = 2*a(n-1) - a(n-2) - a(n-4) with a(0) = a(1) = 0, a(2) = 1, a(3) = 2.
0, 0, 1, 2, 3, 4, 4, 2, -3, -12, -25, -40, -52, -52, -27, 38, 155, 324, 520, 678, 681, 360, -481, -2000, -4200, -6760, -8839, -8918, -4797, 6084, 25804, 54442, 87877, 115228, 116775, 63880, -76892, -332892, -705667, -1142322
Offset: 0
Keywords
Links
- G. C. Greubel, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (2,-1,0,-1).
Programs
-
GAP
a:=[0,0,1,2];; for n in [5..40] do a[n]:=2*a[n-1]-a[n-2]-a[n-4]; od; a; # G. C. Greubel, Jun 12 2019
-
Magma
R
:=PowerSeriesRing(Integers(), 40); [0,0] cat Coefficients(R!( x^2/(1-2*x+x^2+x^4) )); // G. C. Greubel, Jun 12 2019 -
Mathematica
Table[-Im[Det[Array[KroneckerDelta[#1 + 1, #2]*Sqrt[I] &, {n, n}] + Array[KroneckerDelta[#1 - 1, #2]*Sqrt[I] &, {n, n}] + IdentityMatrix[n]]], {n, 1, 40}] (* John M. Campbell, Jun 04 2011 *) LinearRecurrence[{2,-1,0,-1}, {0,0,1,2}, 40] (* G. C. Greubel, Jun 12 2019 *)
-
PARI
my(x='x+O('x^40)); concat([0,0], Vec(x^2/(1-2*x+x^2+x^4))) \\ G. C. Greubel, Jun 12 2019
-
Sage
(x^2/(1-2*x+x^2+x^4)).series(x, 40).coefficients(x, sparse=False) # G. C. Greubel, Jun 12 2019
Formula
a(n) = Sum_{k=0..floor((n+2)/2)} binomial(n-k+2, k)*sin(Pi*k/2). - Paul Barry, Apr 25 2005
G.f.: x^2/(1 - 2*x + x^2 + x^4). - R. J. Mathar, Oct 22 2008
Comments