OFFSET
0,2
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
FORMULA
a(2*n-1) = A027307(n), n >= 1.
a(n) = 2*A084075(n-1), n >= 1.
a(n) = ( 6*(35*n^2 -55*n -76)*a(n-1) + (275*n^4 -770*n^3 -203*n^2 +1736*n -912)*a(n-2) - 6*(5*n^2 +5*n -28)*a(n-3) + (n-4)*(n-2)*(25*n^2+5*n-48)*a(n-4) )/(n*(n+2)*(25*n^2 -45*n -28)), for n >= 4. - G. C. Greubel, Nov 24 2022
a(2*n) = A032349(n+1), n >= 0. - Alexander Burstein, Nov 19 2023
EXAMPLE
{0}, {-1,1}, {0,2,-2,0}, {-1,1,-3,-1,1,-1,1,3,-1,1}
MATHEMATICA
Join[{1}, 2*Rest@CoefficientList[InverseSeries[Series[(-1 -6*n -8*n^2 + (1+ 2*n)^2*Sqrt[1+4*n])/(2*(n +4*n^2 +4*n^3)), {n, 0, 40}]], n]]
Length/@ Flatten/@ NestList[# /. k_Integer :> Range[-Abs[k+1], Abs[k-1], 2] &, {0}, 12]
PROG
(Magma) I:=[1, 2, 4, 10]; [n le 4 select I[n] else (6*(35*n^2-125*n+14)*Self(n-1) + (275*n^4 -1870*n^3 +3757*n^2 -1268*n -1806)*Self(n-2) -6*(5*n^2-5*n-28)*Self(n-3) + (n-5)*(n-3)*(25*n^2-45*n-28)*Self(n-4))/((n-1)*(n+1)*(25*n^2-95*n+42)): n in [1..41]]; // G. C. Greubel, Nov 24 2022
(SageMath)
@CachedFunction
def a(n): # a = A084078
if (n<4): return (1, 2, 4, 10)[n]
else: return (6*(35*n^2 -55*n -76)*a(n-1) +(275*n^4-770*n^3-203*n^2+1736*n-912)*a(n-2) -6*(5*n^2+5*n-28)*a(n-3) +(n-4)*(n-2)*(25*n^2+5*n-48)*a(n-4))/(n*(n+2)*(25*n^2-45*n-28))
[a(n) for n in range(41)] # G. C. Greubel, Nov 24 2022
(Python)
def replace(L): return [i for k in L for i in range(-abs(k + 1), 1 + abs(k - 1), 2)]
def aList(upto, L=[0]): return [1] + [len((L := replace(L))) for _ in range(upto)]
print(aList(12)) # Peter Luschny, Nov 16 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Wouter Meeussen, May 11 2003
STATUS
approved