OFFSET
0,2
COMMENTS
Partial sums of A026765.
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
FORMULA
Conjecture: (n+1)*a(n) +(-n-3)*a(n-1) +2*(-5*n+4)*a(n-2) +2*(5*n+3)*a(n-3) +(29*n-83)*a(n-4) +(-29*n+61)*a(n-5) +10*(-2*n+11)*a(n-6) +20*(n-5)*a(n-7)=0. - R. J. Mathar, Jun 30 2013
MAPLE
T:= proc(n, k) option remember;
if n<0 then 0;
elif k=0 or k = n then 1;
elif type(n, 'odd') and 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, Oct 31 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 31 2019 *)
PROG
(Sage)
@CachedFunction
def T(n, k):
if (n<0): return 0
elif (k==0 or k==n): return 1
elif (mod(n, 2)==1 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 31 2019
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved