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.

A026540 a(n) = T(n,n-3), T given by A026536. Also number of integer strings s(0), ..., s(n), counted by T, such that s(n) = 3.

Original entry on oeis.org

1, 2, 6, 16, 36, 104, 215, 635, 1275, 3786, 7518, 22344, 44170, 131264, 259002, 769578, 1517418, 4508580, 8888495, 26412001, 52077234, 154773696, 305257251, 907432695, 1790353357, 5323519838, 10507386918, 31251588060
Offset: 3

Views

Author

Keywords

Crossrefs

Cf. A026536.

Programs

  • Mathematica
    T[n_, k_]:= T[n, k]= If[k==0 || k==2*n, 1, If[k==1 || k==2*n-1, Floor[n/2], If[EvenQ[n], T[n-1, k-2] + T[n-1, k-1] + T[n-1, k], T[n-1, k-2] + T[n-1, k]] ]]; Table[T[n,n-3], {n,3,40}] (* G. C. Greubel, Apr 10 2022 *)
  • SageMath
    @CachedFunction
    def T(n, k): # A026536
        if k < 0 or n < 0: return 0
        elif k == 0 or k == 2*n: return 1
        elif k == 1 or k == 2*n-1: return n//2
        elif n % 2 == 1: return T(n-1, k-2) + T(n-1, k)
        return T(n-1, k-2) + T(n-1, k-1) + T(n-1, k)
    def A026540(n): return T(n,n-3)
    [A026540(n) for n in (3..40)] # G. C. Greubel, Apr 10 2022

Formula

a(n) = A026536(n, n-3).