OFFSET
0,2
COMMENTS
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (2,-1,2).
FORMULA
a(n) = (3*2^n + 2*cos(Pi*n/2) + 4*sin(Pi*n/2))/5.
a(n) = n*Sum_{k=0..floor(n/2)} binomial(n-k, k)*(-1)^k*A100087(n-2*k)/(n-k).
a(n) = 2*a(n-1) + period 4:repeat 0, -2, 0, 2, with a(0) = 1.
a(n) = 2*a(n-1) - a(n-2) + 2*a(n-3).
a(n) = (1/5)*(3*2^n + i^n*(1+(-1)^n) - 2*i^(n+1)*(1-(-1)^n)). - G. C. Greubel, Jul 08 2022
MATHEMATICA
CoefficientList[Series[(1-x^2)/((1-2x)(1+x^2)), {x, 0, 40}], x] (* or *) LinearRecurrence[{2, -1, 2}, {1, 2, 2}, 40] (* Harvey P. Dale, May 12 2011 *)
PROG
(Magma) [n le 3 select Floor((n+2)/2) else 2*Self(n-1) - Self(n-2) +2*Self(n-3): n in [1..41]]; // G. C. Greubel, Jul 08 2022
(SageMath)
def b(n): return (2/5)*(3*2^(2*n-1) + (-1)^n) # b=A122117
def A100088(n): return b(n/2) if (n%2==0) else 2*b((n-1)/2)
[A100088(n) for n in (0..60)] # G. C. Greubel, Jul 08 2022
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Paul Barry, Nov 03 2004
STATUS
approved