login
A026531
a(n) = T(n,0) + T(n,1) + ... + T(n,n), T given by A026519.
21
1, 2, 4, 11, 22, 64, 127, 376, 746, 2222, 4414, 13180, 26215, 78373, 156041, 466840, 930194, 2784266, 5550976, 16620976, 33152042, 99291358, 198115526, 593484440, 1184511095, 3548969075, 7084871668, 21230215328, 42390336619
OFFSET
0,2
LINKS
FORMULA
a(n) = Sum_{j=0..n} A026519(n, j).
MATHEMATICA
T[n_, k_]:= T[n, k]= If[k<0 || k>2*n, 0, If[k==0 || k==2*n, 1, If[k==1 || k==2*n-1, Floor[(n+1)/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 = A026519 *)
a[n_]:= a[n]= Block[{$RecursionLimit = Infinity}, Sum[T[n, j], {j, 0, n}] ];
Table[a[n], {n, 0, 40}] (* G. C. Greubel, Dec 20 2021 *)
PROG
(Sage)
@CachedFunction
def T(n, k): # T = A026519
if (k<0 or k>2*n): return 0
elif (k==0 or k==2*n): return 1
elif (k==1 or k==2*n-1): return (n+1)//2
elif (n%2==0): return T(n-1, k) + T(n-1, k-2)
else: return T(n-1, k) + T(n-1, k-1) + 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 20 2021
KEYWORD
nonn
STATUS
approved