OFFSET
0,5
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (0,1,0,1,0,-1).
FORMULA
G.f.: x*(1+x-x^2+x^3)/((1+x)^2*(1-x)^2*(1+x^2)) = x*(1+x-x^2+x^3)/(1-x^2-x^4+x^6).
a(n) = sin(Pi*n/2)/2 + (n-1)*(1 + (-1)^n)/4.
E.g.f.: (1/2)*(sin(x) + (1 + x)*sinh(x)). - G. C. Greubel, Aug 03 2024
MATHEMATICA
CoefficientList[Series[(x + x^2 - x^3 + x^4)/((1 + x)^2*(1 - x)^2*(1 + x^2)), {x, 0, 50}], x] (* G. C. Greubel, May 15 2016 *)
PROG
(Magma)
A166514:= func< n | ((n mod 2)*(1-(-1)^Floor((n+1)/2)) +((n+1) mod 2)*n)/2 >;
[A166514(n): n in [0..100]]; // G. C. Greubel, Aug 03 2024
(SageMath)
def A166514(n): return ((n%2)*(1+(-1)^((n-1)//2)) +((n+1)%2)*n)/2
[A166514(n) for n in range(101)] # G. C. Greubel, Aug 03 2024
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Paul Barry, Oct 16 2009
STATUS
approved