A100088 Expansion of (1-x^2)/((1-2*x)*(1+x^2)).
1, 2, 2, 4, 10, 20, 38, 76, 154, 308, 614, 1228, 2458, 4916, 9830, 19660, 39322, 78644, 157286, 314572, 629146, 1258292, 2516582, 5033164, 10066330, 20132660, 40265318, 80530636, 161061274, 322122548, 644245094, 1288490188, 2576980378
Offset: 0
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).
Programs
-
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
-
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 *)
-
Python
def A100088(n): return ((4<
Chai Wah Wu, Apr 22 2025 -
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
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
Comments