OFFSET
0,4
COMMENTS
Diagonal sums of number array A124394.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (2,0,-2).
FORMULA
a(n) = Sum_{k=0..floor(n/2)} Sum{j=0..k+1} C(k+1,j)*C(n-j+1,2k+1)*(-2)^j.
a(n) = term (2,2) in the 3 X 3 matrix [2,1,0; 0,0,1; -2,0,0]^n. - Alois P. Heinz, Sep 10 2008
a(n) = 2*a(n-1) - 2*a(n-3); a(0)=1, a(1)=0, a(2)=0. - Harvey P. Dale, Dec 21 2013
MAPLE
a:= n-> (Matrix([[2, 1, 0], [0, 0, 1], [-2, 0, 0]])^n)[2, 2]: seq (a(n), n=0..35); # Alois P. Heinz, Sep 10 2008
MATHEMATICA
CoefficientList[Series[(1-2x)/(1-2x+2x^3), {x, 0, 50}], x] (* or *) LinearRecurrence[{2, 0, -2}, {1, 0, 0}, 50] (* Harvey P. Dale, Dec 21 2013 *)
PROG
(PARI) my(x='x+O('x^50)); Vec((1-2*x)/(1-2*x+2*x^3)) \\ G. C. Greubel, Dec 25 2019
(Magma) I:=[1, 0, 0]; [n le 3 select I[n] else 2*Self(n-1) - 2*Self(n-3): n in [1..50]]; // G. C. Greubel, Dec 25 2019
(Sage)
def A124395_list(prec):
P.<x> = PowerSeriesRing(ZZ, prec)
return P( (1-2*x)/(1-2*x+2*x^3) ).list()
A124395_list(50) # G. C. Greubel, Dec 25 2019
(GAP) a:=[1, 0, 0];; for n in [3..50] do a[n]:=2*a[n-1]-2*a[n-3]; od; a; # G. C. Greubel, Dec 25 2019
CROSSREFS
KEYWORD
easy,sign
AUTHOR
Paul Barry, Oct 30 2006
STATUS
approved