login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A026778
a(n) = Sum_{i=0..n} Sum_{j=0..n} T(i,j), T given by A026769.
10
1, 3, 7, 16, 35, 78, 171, 383, 849, 1919, 4301, 9807, 22193, 50993, 116349, 269094, 618277, 1437916, 3323277, 7764996, 18035275, 42304904, 98668223, 232198092, 543453693, 1282401208, 3010275001, 7119589730, 16753996391
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 n=2 and k=1 then 2;
elif k <= (n-1)/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) ;
end if ;
end proc;
seq(add(add(T(j, k), k=0..n), j=0..n), n=0..30); # G. C. Greubel, Nov 01 2019
MATHEMATICA
T[n_, k_]:= T[n, k]= If[n<0, 0, If[k==0 || k==n, 1, If[n==2 && k==1, 2, If[k<=(n-1)/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 01 2019 *)
PROG
(Sage)
@CachedFunction
def T(n, k):
if n < 0:
return 0
elif (k==0 or k==n): return 1
elif (n==2 and k==1): return 2
elif (k<=(n-1)/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 01 2019
KEYWORD
nonn
STATUS
approved