login
A026539
a(n) = T(n,n-2), T given by A026536. Also a(n) = number of integer strings s(0), ..., s(n), counted by T, such that s(n) = 2.
2
1, 1, 5, 8, 27, 49, 150, 284, 845, 1625, 4797, 9288, 27377, 53207, 156900, 305720, 902394, 1761882, 5205950, 10181720, 30114073, 58983859, 174609162, 342449340, 1014555607, 1992082339, 5906040623, 11608506392, 34438443075
OFFSET
2,3
LINKS
FORMULA
a(n) = A026536(n, n-2).
MATHEMATICA
T[n_, k_]:= T[n, k]= If[k==0 || k==2*n, 1, If[k==1 || k==2*n-1, Floor[n/2], If[EvenQ[n], T[n-1, k-2] + T[n-1, k-1] + T[n-1, k], T[n-1, k-2] + T[n-1, k]] ]]; Table[T[n, n-2], {n, 2, 35}] (* G. C. Greubel, Apr 10 2022 *)
PROG
(SageMath)
@CachedFunction
def T(n, k): # A026536
if k < 0 or n < 0: return 0
elif k == 0 or k == 2*n: return 1
elif k == 1 or k == 2*n-1: return n//2
elif n % 2 == 1: return T(n-1, k-2) + T(n-1, k)
return T(n-1, k-2) + T(n-1, k-1) + T(n-1, k)
def A026539(n): return T(n, n-2)
[A026539(n) for n in (2..35)] # G. C. Greubel, Apr 10 2022
CROSSREFS
Cf. A026536.
Sequence in context: A192920 A162562 A182543 * A126700 A076593 A219775
KEYWORD
nonn
STATUS
approved