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.

A026521 a(n) = T(n, n-1), T given by A026519. Also a(n) = number of integer strings s(0), ..., s(n), counted by T, such that s(n) = 1.

Original entry on oeis.org

1, 1, 4, 6, 19, 33, 98, 180, 526, 990, 2887, 5502, 16073, 30863, 90386, 174456, 512128, 992304, 2918954, 5673140, 16716998, 32571858, 96119927, 187675644, 554524660, 1084649644, 3208254571, 6284986554, 18607536319, 36501029265
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    T[n_, k_]:= T[n, k]= If[k==0 || k==2*n, 1, If[k==1 || k==2*n-1, Floor[(n+1)/2], If[EvenQ[n], T[n-1, k-2] + T[n-1, k], T[n-1, k-1] + T[n-1, k-2] + T[n-1, k]]]]; (* T = A026519 *)
    Table[T[n, n-1], {n,40}] (* G. C. Greubel, Dec 19 2021 *)
  • Sage
    @CachedFunction
    def T(n,k): # T = A026552
        if (k==0 or k==2*n): return 1
        elif (k==1 or k==2*n-1): return (n+1)//2
        elif (n%2==0): return T(n-1, k) + T(n-1, k-2)
        else: return T(n-1, k) + T(n-1, k-1) + T(n-1, k-2)
    [T(n,n-1) for n in (1..40)] # G. C. Greubel, Dec 19 2021

Formula

a(n) = A026519(n, n-1).
a(n) = A026537(n+1)/2.