[go: up one dir, main page]

login
A026788
a(n) = Sum_{k=0..floor(n/2)} T(n,k), T given by A026780.
11
1, 1, 4, 6, 20, 34, 105, 191, 563, 1071, 3057, 6007, 16745, 33729, 92332, 189662, 511812, 1068178, 2849404, 6025594, 15921514, 34043204, 89242582, 192621212, 501574732, 1091400122, 2825710822, 6192005260, 15952433940, 35172854946
OFFSET
0,3
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(T(n, k), k=0..floor(n/2)), 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[n, k], {k, 0, Floor[n/2]}], {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(T(n, k) for k in (0..floor(n/2))) for n in (0..30)] # G. C. Greubel, Nov 02 2019
KEYWORD
nonn
STATUS
approved