login
a(n) = Sum_{i=0..n} Sum_{j=0..n} T(i,j), T given by A026725.
1

%I #10 Oct 26 2019 16:12:35

%S 1,3,7,16,34,74,154,330,682,1451,2989,6332,13018,27495,56449,118954,

%T 243964,513180,1051612,2208856,4523344,9489604,19422124,40704746,

%U 83269990,174366100,356558320,746073604,1525104172,3189119418

%N a(n) = Sum_{i=0..n} Sum_{j=0..n} T(i,j), T given by A026725.

%H G. C. Greubel, <a href="/A026734/b026734.txt">Table of n, a(n) for n = 0..1000</a>

%p A026725:= proc(n,k) option remember;

%p if n<0 or k<0 then 0;

%p elif k=0 or k=n then 1;

%p elif 2*k = n-1 then procname(n-1,k-1)+procname(n-2,k-1) + procname(n-1,k) ;

%p else procname(n-1,k-1)+procname(n-1,k) ;

%p fi; end proc:seq(add(add(A026725(i,j), j=0..n), i=0..n), n=0..30); # _G. C. Greubel_, Oct 26 2019

%t 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 *)

%o (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) )));

%o vector(31, n, sum(j=0,n-1, sum(i=0,n-1, T(j,i))) ) \\ _G. C. Greubel_, Oct 26 2019

%o (Sage)

%o @CachedFunction

%o def T(n, k):

%o if (n<0): return 0

%o elif (k==0 or k==n): return 1

%o 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)

%o else: return T(n-1, k-1) + T(n-1, k)

%o [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

%o (GAP)

%o T:= function(n,k)

%o if n<0 then return 0;

%o elif k=0 or k=n then return 1;

%o elif 2*k=n-1 then return T(n-1, k-1) + T(n-2, k-1) + T(n-1, k);

%o else return T(n-1, k-1) + T(n-1, k);

%o fi;

%o end;

%o List([0..30], n-> Sum([0..n], k-> Sum([0..n], j-> T(j,k) )))); # _G. C. Greubel_, Oct 26 2019

%Y Partial sums of A026732.

%K nonn

%O 0,2

%A _Clark Kimberling_