OFFSET
0,4
COMMENTS
Diagonal sums of A098599.
The signed sequence 1,-1,0,-3,0,-4,... gives the diagonal sums of A100218. - Paul Barry, Nov 09 2004
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (-1,1,2,1).
FORMULA
G.f.: x/((1+x)*(1-x^2-x^3)) + 1/(1-x^2-x^3).
a(n) = Sum_{k=0..floor(n/2)} (binomial(k, n-2*k) + binomial(k-1, n-2*k-1)).
a(n) = -a(n-1) + a(n-2) + 2*a(n-3) + a(n-4).
Inverse binomial transform of A135364. - Paul Curtz, Apr 25 2008
MATHEMATICA
CoefficientList[Series[(1+2x)/((1+x)(1-x^2-x^3)), {x, 0, 50}], x] (* or *) LinearRecurrence[{-1, 1, 2, 1}, {1, 1, 0, 3}, 50] (* Harvey P. Dale, Dec 14 2011 *)
PROG
(Magma) I:=[1, 1, 0, 3]; [n le 4 select I[n] else -Self(n-1) +Self(n-2) +2*Self(n-3) +Self(n-4): n in [1..55]]; // G. C. Greubel, Mar 27 2024
(SageMath)
def A098601(n): return sum( binomial(k, n-2*k) + binomial(k-1, n-2*k-1) for k in range(1+n//2))
[A098601(n) for n in range(56)] # G. C. Greubel, Mar 27 2024
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Paul Barry, Sep 17 2004
STATUS
approved