login
A026524
a(n) = T(n, n-4), T given by A026519. Also a(n) = number of integer strings s(0), ..., s(n), counted by T, such that s(n) = 4.
21
1, 3, 9, 28, 65, 201, 430, 1316, 2721, 8259, 16793, 50680, 102102, 306958, 615024, 1844304, 3682545, 11024331, 21963161, 65675764, 130648089, 390374193, 775797750, 2316881892, 4601346295, 13737041045, 27270124455
OFFSET
4,2
LINKS
Veronika Irvine, Stephen Melczer and Frank Ruskey, Vertically constrained Motzkin-like paths inspired by bobbin lace, arXiv:1804.08725 [math.CO], 2018.
FORMULA
a(n) = A026519(n, n-4).
MATHEMATICA
T[n_, k_]:= T[n, k]= 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 *)
Table[T[n, n-4], {n, 4, 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+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)
[T(n, n-4) for n in (4..40)] # G. C. Greubel, Dec 19 2021
KEYWORD
nonn
STATUS
approved