login
A026789
a(n) = Sum_{i=0..n} Sum_{j=0..n} T(i,j), T given by A026780.
11
1, 3, 8, 19, 45, 103, 239, 545, 1262, 2887, 6700, 15397, 35848, 82757, 193320, 448175, 1050217, 2443963, 5743267, 13410053, 31593029, 73984575, 174689181, 410141597, 970289011, 2283205051, 5410611863, 12756825609, 30274963923
OFFSET
0,2
LINKS
MAPLE
T:= proc(n, k) option remember;
if n<0 then 0;
elif k=0 or k =n then 1;
elif k <= n/2 then
procname(n-1, k-1)+procname(n-2, k-1)+procname(n-1, k) ;
else
procname(n-1, k-1)+procname(n-1, k) ;
fi ;
end proc:
seq( add(add(T(j, k), k=0..n), j=0..n), n=0..30); # G. C. Greubel, Nov 02 2019
MATHEMATICA
T[n_, k_]:= T[n, k]= If[n<0, 0, If[k==0 || k==n, 1, If[k<=n/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[T[j, k], {k, 0, n}, {j, 0, n}], {n, 0, 30}] (* G. C. Greubel, Nov 02 2019 *)
PROG
(Sage)
@CachedFunction
def T(n, k):
if (n<0): return 0
elif (k==0 or k==n): return 1
elif (k<=n/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( sum( T(j, k) for k in (0..n)) for j in (0..n)) for n in (0..30)] # G. C. Greubel, Nov 02 2019
CROSSREFS
KEYWORD
nonn
STATUS
approved