login
A026563
a(n) = T(n, floor(n/2)), where T is given by A026552.
18
1, 1, 2, 2, 7, 8, 24, 28, 93, 111, 362, 436, 1452, 1763, 5880, 7176, 24089, 29521, 99386, 122182, 412637, 508595, 1721500, 2126312, 7211536, 8923136, 30312960, 37563930, 127790379, 158563368, 540082784, 670893296, 2287577537
OFFSET
0,3
LINKS
FORMULA
a(n) = A026552(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)/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=A026552 *)
a[n_]:= a[n]= Block[{$RecursionLimit = Infinity}, T[n, Floor[n/2]]];
Table[a[n], {n, 0, 40}] (* G. C. Greubel, Dec 18 2021 *)
PROG
(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+2)//2
elif (n%2==0): return T(n-1, k) + T(n-1, k-1) + T(n-1, k-2)
else: return T(n-1, k) + T(n-1, k-2)
[T(n, n//2) for n in (0..40)] # G. C. Greubel, Dec 18 2021
KEYWORD
nonn
STATUS
approved