OFFSET
0,3
COMMENTS
a(n) is the number of nonnegative integer solutions to the equation x+y+z=n such that x+y=z. - Geoffrey Critzer, Jul 12 2013
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..5000
Index entries for linear recurrences with constant coefficients, signature (0,2,0,-1)
FORMULA
From Paul Barry, May 27 2003: (Start)
Binomial transform is A045891. Partial sums are A008805. The sequence 0, 1, 0, 2, ... has a(n)=floor((n+2)/2)(1-(-1)^n)/2.
a(n) = floor((n+3)/2) * (1+(-1)^n)/2. (End)
a(n) = (n+2)(n+3)/2 mod n+2. - Amarnath Murthy, Jun 17 2004
a(n) = (n+2)*(1 + (-1)^n)/4. - Bruno Berselli, Apr 01 2011
E.g.f.: cosh(x) + x*sinh(x)/2. - Stefano Spezia, Mar 26 2022
MATHEMATICA
CoefficientList[Series[1/(1-x^2)^2, {x, 0, 100}], x] (* Geoffrey Critzer, Jul 12 2013 *)
PROG
(Magma) [(n+2)*(1+(-1)^n)/4: n in [0..75]]; // Vincenzo Librandi, Apr 02 2011
(PARI) a(n)=if(n%2, 0, n/2+1) \\ Charles R Greathouse IV, Jan 18 2012
(SageMath) [(n+2)*((n+1)%2)/2 for n in (0..80)] # G. C. Greubel, Aug 01 2022
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved