login
A026564
a(n) = Sum_{j=0..n} T(n, j), where T is given by A026552.
8
1, 2, 6, 11, 33, 64, 191, 376, 1122, 2222, 6636, 13180, 39395, 78373, 234414, 466840, 1397034, 2784266, 8335242, 16620976, 49773018, 99291358, 297406884, 593484440, 1777995535, 3548969075, 10633840743, 21230215328, 63620551947
OFFSET
0,2
LINKS
FORMULA
a(n) = Sum_{j=0..n} A026552(n, j).
MATHEMATICA
T[n_, k_]:= T[n, k]= If[k==0 || k==2*n, 1, If[k==1 || k==2*n-1, Floor[(n+2)/2], If[EvenQ[n], T[n-1, k-2] + T[n-1, k] + T[n-1, k-1], T[n-1, k-2] + T[n-1, k]]]]; (* T=A026552 *)
a[n_]:= a[n]= Block[{$RecursionLimit = Infinity}, Sum[T[n, k], {k, 0, n}]];
Table[a[n], {n, 0, 40}] (* G. C. Greubel, Dec 19 2021 *)
PROG
(Sage)
@CachedFunction
def T(n, k): # T = A026552
if (k==0 or k==2*n): return 1
elif (k==1 or k==2*n-1): return (n+2)//2
elif (n%2==0): return T(n-1, k) + T(n-1, k-1) + T(n-1, k-2)
else: return T(n-1, k) + T(n-1, k-2)
@CachedFunction
def a(n): return sum( T(n, k) for k in (0..n) )
[a(n) for n in (0..40)] # G. C. Greubel, Dec 19 2021
KEYWORD
nonn
STATUS
approved