A formula for the number of up-down words
Sela Fried
TL;DR
The paper addresses the enumeration of up-down words over an alphabet of size $k$ and derives a closed-form formula for $f_{k,n}$, the number of up-down words of length $n$. It builds on the generating-function framework of Carlitz and Scoville and expresses the relevant generating functions $F_k$ and $G_k$ through Chebyshev-polynomial identities by identifying $Q_k(x)=V_{k-1}igl(1-rac{x^{2}}{2}igr)$ and applying a partial-fraction decomposition over the real roots of $V_{k-1}$. This yields the explicit formula $f_{k,n}=1_{n=1}+rac{4}{2k-1} ext{ } obreakrac{ ext{cos}^{2}igl(rac{(i-rac{1}{2}) ext{ } ext{ }rac{ ext{ } ext{ } ext{π}}{2k-1}igr)}{(2(-1)^{i+1} ext{ sin}igl(rac{(i-rac{1}{2}) ext{ } ext{ } ext{π}}{2k-1}igr))^{n+1}}$ for all $n$ (equivalently the absolute-value form). The authors also discuss extensions to weakly up-down words and to a cyclic analogue, with corresponding generating functions and recurrences that connect to Fibonacci and Lucas numbers in special cases.
Abstract
A word $w_1w_2\cdots w_n$ is said to be up-down if $w_1 < w_2 >w_3 \cdots$. Carlitz and Scoville found the generating function for the number of up-down words over an alphabet of size $k$. Using properties of the Chebyshev polynomials we derive a closed-form formula for these numbers.
