login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A026522 a(n) = T(n, n-2), where T is given by A026519. Also number of integer strings s(0), ..., s(n), counted by T, such that s(n) = 2. 21
1, 2, 5, 13, 27, 76, 150, 434, 845, 2470, 4797, 14085, 27377, 80584, 156900, 462620, 902394, 2664276, 5205950, 15387670, 30114073, 89097932, 174609162, 517058502, 1014555607, 3006637946, 5906040623, 17514547015, 34438443075 (list; graph; refs; listen; history; text; internal format)
OFFSET
2,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-2).
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-2], {n, 2, 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-2) for n in (2..40)] # G. C. Greubel, Dec 19 2021
CROSSREFS
Sequence in context: A289774 A126656 A272794 * A216378 A225690 A193044
KEYWORD
nonn
AUTHOR
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 11:13 EDT 2024. Contains 371905 sequences. (Running on oeis4.)