OFFSET
0,2
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
MATHEMATICA
T[n_, k_]:= T[n, k] = If[k==0 || k==n, 1, If[EvenQ[n] && k==(n-2)/2, T[n-1, k-1] + T[n-2, k-1] + T[n-1, k], T[n-1, k-1] + T[n-1, k]]]; Table[Sum[(k+1)*T[n, n-k], {k, 0, n}], {n, 0, 30}] (* G. C. Greubel, Jul 19 2019 *)
PROG
(Sage)
@CachedFunction
def T(n, k):
if (k==0 or k==n): return 1
elif (mod(n, 2)==0 and k==(n-2)/2): return T(n-1, k-1) + T(n-2, k-1) + T(n-1, k)
else: return T(n-1, k-1) + T(n-1, k)
[sum((k+1)*T(n, n-k) for k in (0..n)) for n in (0..30)] # G. C. Greubel, Jul 19 2019
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved