login
A026595
a(n) = T(n, floor(n/2)), where T is given by A026584.
18
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,5
LINKS
FORMULA
a(n) = A026584(n, floor(n/2))
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 *)
PROG
(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
KEYWORD
nonn
STATUS
approved