OFFSET
0,2
COMMENTS
a(n) is the number of up-down words of length n over an alphabet of size 4. - Sela Fried, Apr 08 2025
REFERENCES
L. Carlitz and R. Scoville, Up-down sequences, Duke Math. J. (39) (1972), 583-598.
LINKS
Sela Fried, A formula for the number of up-down words, arXiv:2503.02005 [math.CO], 2025.
Emma L. L. Gao, Sergey Kitaev, and Philip B. Zhang, Pattern-avoiding alternating words, arXiv:1505.04078 [math.CO], 2015.
Index entries for linear recurrences with constant coefficients, signature (2,1,-1).
FORMULA
a(n) = [x^n] (x^4 - x^3 - 3*x^2 + 2*x + 1) / (x^3 - x^2 - 2*x + 1).
MATHEMATICA
CoefficientList[Series[x + 1/(-x - 1/(-x - 1/(-x + 1))), {x, 0, 31}], x] (* Michael De Vlieger, Jun 10 2024 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Peter Luschny, Jun 10 2024
STATUS
approved
