OFFSET
0,2
COMMENTS
The terms a(0)..a(25) obey a linear recurrence with polynomial coefficients of degree 7. - Ralf Stephan, May 31 2014
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
FORMULA
0 = a(n)*(9*n + 9) + a(n+1)*(3*n + 21) + a(n+2)*(13*n - 5) + a(n+3)*(-29*n + 11) + a(n+4)*(-13*n - 121) + a(n+5)*(25*n + 123) + a(n+6)*(-98n - 43) + a(n+7)*(n + 5) for n>=-1. - Michael Somos, May 31 2014
0 = a(n)*(+81*a(n+1) + 189*a(n+2) + ... + 45*a(n+8)) + a(n+1)*(-135*a(n+1) + ...) + ... + a(n+7)*(-7*a(n+7) + a(n+8)) for n>=-1. - Michael Somos, May 31 2014
EXAMPLE
G.f. = 1 + 4*x + 13*x^2 + 38*x^3 + 111*x^4 + 326*x^5 + 961*x^6 + 2842*x^7 + ...
MAPLE
T:= proc(n, k) option remember;
if k<0 or k>2*n then 0
elif k=0 or k=2 or k=2*n then 1
elif k=1 then 0
else add(T(n-1, k-j), j=1..3)
fi
end:
seq( add((k+1)*T(n, 2*n-k), k=0..2*n), n=0..30); # G. C. Greubel, Nov 06 2019
MATHEMATICA
T[n_, k_]:= T[n, k]= If[k<0 || k>2*n, 0, If[k==0 || k==2 || k==2*n, 1, If[k==1, 0, Sum[T[n-1, k-j], {j, 3}]]]]; Table[Sum[(k+1)*T[n, 2*n-k], {k, 0, 2*n}], {n, 0, 30}] (* G. C. Greubel, Nov 06 2019 *)
PROG
(Sage)
@CachedFunction
def T(n, k):
if (k<0 or k>2*n): return 0
elif (k==0 or k==2 or k==2*n): return 1
elif (k==1): return 0
else: return sum(T(n-1, k-j) for j in (1..3))
[sum((k+1)*T(n, 2*n-k) for k in (0..2*n)) for n in (0..30)] # G. C. Greubel, Nov 06 2019
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved