login
A026734
a(n) = Sum_{i=0..n} Sum_{j=0..n} T(i,j), T given by A026725.
1
1, 3, 7, 16, 34, 74, 154, 330, 682, 1451, 2989, 6332, 13018, 27495, 56449, 118954, 243964, 513180, 1051612, 2208856, 4523344, 9489604, 19422124, 40704746, 83269990, 174366100, 356558320, 746073604, 1525104172, 3189119418
OFFSET
0,2
LINKS
MAPLE
A026725:= proc(n, k) option remember;
if n<0 or k<0 then 0;
elif k=0 or k=n then 1;
elif 2*k = n-1 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(A026725(i, j), j=0..n), i=0..n), n=0..30); # G. C. Greubel, Oct 26 2019
MATHEMATICA
T[n_, k_]:= T[n, k]= If[n<0, 0, If[k==0 || k==n, 1, If[OddQ[n] && 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, Oct 26 2019 *)
PROG
(PARI) T(n, k) = if(n<0, 0, if(k==n || k==0, 1, if(2*k==n-1, T(n-1, k-1) + T(n-2, k-1) + T(n-1, k), T(n-1, k-1) + T(n-1, k) )));
vector(31, n, sum(j=0, n-1, sum(i=0, n-1, T(j, i))) ) \\ G. C. Greubel, Oct 26 2019
(Sage)
@CachedFunction
def T(n, k):
if (n<0): return 0
elif (k==0 or k==n): return 1
elif (mod(n, 2)==0 and 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, Oct 26 2019
(GAP)
T:= function(n, k)
if n<0 then return 0;
elif k=0 or k=n then return 1;
elif 2*k=n-1 then 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);
fi;
end;
List([0..30], n-> Sum([0..n], k-> Sum([0..n], j-> T(j, k) )))); # G. C. Greubel, Oct 26 2019
CROSSREFS
Partial sums of A026732.
Sequence in context: A281811 A238089 A335713 * A026767 A240740 A239257
KEYWORD
nonn
STATUS
approved