login
a(n) = T(n, n-3), T given by A026519. Also a(n) = number of integer strings s(0), ..., s(n), counted by T, such that s(n) = 3.
21

%I #17 Dec 20 2021 09:43:27

%S 1,2,8,16,52,104,319,635,1910,3786,11304,22344,66514,131264,390266,

%T 769578,2286996,4508580,13397075,26412001,78489235,154773696,

%U 460030947,907432695,2697786052,5323519838,15830906756,31251588060

%N a(n) = T(n, n-3), T given by A026519. Also a(n) = number of integer strings s(0), ..., s(n), counted by T, such that s(n) = 3.

%H G. C. Greubel, <a href="/A026523/b026523.txt">Table of n, a(n) for n = 3..1000</a>

%H Veronika Irvine, Stephen Melczer and Frank Ruskey, <a href="https://arxiv.org/abs/1804.08725">Vertically constrained Motzkin-like paths inspired by bobbin lace</a>, arXiv:1804.08725 [math.CO], 2018.

%F a(n) = A026519(n, n-3).

%t 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 *)

%t Table[T[n, n-3], {n,3,40}] (* _G. C. Greubel_, Dec 19 2021 *)

%o (Sage)

%o @CachedFunction

%o def T(n,k): # T = A026552

%o if (k==0 or k==2*n): return 1

%o elif (k==1 or k==2*n-1): return (n+1)//2

%o elif (n%2==0): return T(n-1, k) + T(n-1, k-2)

%o else: return T(n-1, k) + T(n-1, k-1) + T(n-1, k-2)

%o [T(n,n-3) for n in (3..40)] # _G. C. Greubel_, Dec 19 2021

%Y Cf. A026519, A026520, A026521, A026522, A026524, A026525, A026526, A026527, A026528, A026529, A026530, A026531, A026533, A026534, A027262, A027263, A027264, A027265, A027266.

%K nonn

%O 3,2

%A _Clark Kimberling_