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.

A026595 a(n) = T(n, floor(n/2)), where T is given by A026584.

Original entry on oeis.org

1, 1, 1, 1, 5, 8, 19, 22, 69, 121, 341, 406, 1203, 2155, 6336, 7624, 22593, 40717, 121483, 147001, 438533, 792351, 2381512, 2892044, 8677763, 15703156, 47419503, 57728737, 173984792, 315180458, 954961034, 1164727748, 3522101709
Offset: 0

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/2], If[EvenQ[n+k], T[n-1, k-2] + T[n-1, k], T[n-1, k-2] + T[n-1, k-1] + T[n-1, k] ]]]; (* T = A026584 *)
    Table[T[n, Floor[n/2]], {n, 0, 40}] (* G. C. Greubel, Dec 13 2021 *)
  • Sage
    @CachedFunction
    def T(n, k):  # T = A026584
        if (k==0 or k==2*n): return 1
        elif (k==1 or k==2*n-1): return (n//2)
        else: return T(n-1, k-2) + T(n-1, k) if ((n+k)%2==0) else T(n-1, k-2) + T(n-1, k-1) + T(n-1, k)
    [T(n, n//2) for n in (0..40)] # G. C. Greubel, Dec 13 2021

Formula

a(n) = A026584(n, floor(n/2))