OFFSET
0,4
COMMENTS
Diagonal sums of number triangle A117411.
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (0,2,-4,-1).
FORMULA
a(n) = 2*a(n-2) - 4*a(n-3) - a(n-4).
a(n) = Sum_{k=0..floor(n/2)} Sum_{j=0..n-2*k} C(n-k, k-j)*C(j, n-2*k)*(-4)^(n-2*k).
MATHEMATICA
CoefficientList[Series[(1-x^2)/(1-2x^2+4x^3+x^4), {x, 0, 40}], x] (* or *) LinearRecurrence[{0, 2, -4, -1}, {1, 0, 1, -4}, 40] (* Harvey P. Dale, Jul 12 2017 *)
PROG
(Magma) I:=[1, 0, 1, -4]; [n le 4 select I[n] else 2*Self(n-1) -4*Self(n-2) -Self(n-3): n in [1..41]]; // G. C. Greubel, Sep 07 2022
(SageMath)
@CachedFunction
def a(n): # a = A117413
if(n<4): return (1, 0, 1, -4)[n]
else: return 2*a(n-2) - 4*a(n-3) - a(n-4)
[a(n) for n in (0..40)] # G. C. Greubel, Sep 07 2022
CROSSREFS
KEYWORD
easy,sign
AUTHOR
Paul Barry, Mar 14 2006
STATUS
approved