cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A084078 Length of list created by n substitutions k -> Range[-abs(k+1), abs(k-1), 2] starting with {0}.

Original entry on oeis.org

1, 2, 4, 10, 24, 66, 172, 498, 1360, 4066, 11444, 34970, 100520, 312066, 911068, 2862562, 8457504, 26824386, 80006116, 255680170, 768464312, 2471150402, 7474561164, 24161357010, 73473471344, 238552980386, 728745517972
Offset: 0

Views

Author

Wouter Meeussen, May 11 2003

Keywords

Examples

			{0}, {-1,1}, {0,2,-2,0}, {-1,1,-3,-1,1,-1,1,3,-1,1}
		

Crossrefs

Programs

  • 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
    
  • 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]
  • 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
  • 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
    

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