subset of paths $P$ with $\ell(P)=s$, where $\ell(P)$ denotes the length of the endpoint of $P$. Obviously (compare with ), $$\mathcal{D}_{n}=\bigcup_{s\geq 0} \mathcal{D}_n(s),\ \ |\mathcal{D}_s(s)|=1, \ \ |\mathcal{D}_n(0)|=\delta_{n,0}, \ \ \mathcal{D}_n(s)=\emptyset, \ \text{ if } s-n\notin 2{\mathbb Z}_+.$$ Further, let $\mathcal{D}^{m}_n$ the subset of paths which do not cross the line $y=m$, i.e. $$\mathcal{D}^{m}_n=\{P\in \mathcal{D}_{n}:  \text{ht}_z(P)\leq m \text{ for all } z\in \text{supp}(P)\},\ \ \mathcal{D}_n^{m}(s):=\mathcal{D}_n^m\cap \mathcal{D}_n(s).$$

(0,0) grid (20,6); (0,0) – (3,3) – (5,1) – (8,4)–(12,0)–(17,5)–(20,2);

In analogy to we set $$\label{initial2}
\mathcal{D}_n(s)=0,\  \ {\rm{if}} \ \ s<0\ \   {\rm{or}}\  n<0.$$

In the literature a Dyck path mostly ends at height $0$ and a diagonal lattice path that ends at an arbitrary height is often called a generalized Dyck path. It is well–known that the cardinality of $\mathcal{D}_{0}(2k)$ is given by the $k$–th Catalan number; for further combinatorial interpretations of the Catalan numbers we refer to the book of Stanley [@S99 pg. 219-229].

 {#section-3}

The generating function $\mathcal{G}_n^m(x)=\sum_{s\geq 0}|\mathcal{D}^m_{n}(s)| x^{(s-n)/2}$ has been intensively studied in [@GX05]. It turns out that $\mathcal{G}_n^m(x)$ is a rational function which can be expressed in terms of Chebyshev polynomials. We shall explain this connection in more detail. The Chebyshev polynomials of the second kind are 