Let $n$ be a nonnegative integer. It is well-known that the number of lattice paths from $(0, 0)$ to $(n, n)$ with steps $(0, 1)$ and $(1, 0)$ that are never rising above the line $y=x$ is given by the Catalan number $C\_n$. There are lots of generalisations of Catalan numbers in the literature; however, I have a different approach to these numbers which I could not manage to find any known results about.



> 
> **Question:** Let $a$ and $b$ be nonnegative integers. What is the number of lattice paths from $(0, 0)$ to $(a, b)$ with steps $(0, 1)$ and $(1, 0)$ that are never rising above the line $bx-ay=0$?
> 
> 
> 


Let $C(a, b)$ be the integer valued function that counts the number of such lattice paths. It is clear that
$$
C(n,n) = C\_n = \frac{1}{n+1}\binom{2n}{n}
$$
for every nonnegative integer $n$. We also know that $C(a,b)=C(b,a)$, which can be obtained by setting up a bijection between the two sets of such paths by means of reflecting the paths across the line $y=x$, so we can take $a≤b$ without loss of generality.


In the case of $a \mid b$, there is a well-known solution to the problem that is discussed by [Hilton and Pedersen](http://www.math.uakron.edu/%7Ecossey/636papers/hilton%20and%20pedersen.pdf), [Sands](https://www.sciencedirect.com/science/article/pii/0012365X78900948) and possibly many others:


$$
C(a,ma) = \frac{1}{ma+1} \binom{a(m+1)}{a}.
$$


Besides, there is a powerful enumeration tool called *The Cycle Lemma* (see [Dvoretzky and Motzkin](https://projecteuclid.org/euclid.dmj/1077474127)) which can be used to prove the equations mentioned above. Furthermore, it is possible to solve the problem thanks to the Cycle Lemma when $a$ and $b$ are coprime integers:


$$
gcd⁡(a,b)=1 \Rightarrow C(a,b) = \frac{1}{a+b} \binom{a+b}{a}.
$$


Unfortunately, none of my findings could prove itself useful in finding a general solution to the problem. Are there any existing papers or known results that shed some light on this question? If not, how can we achieve an explicit formula of $C(a,b)$?



A generalisation of the Catalan numbers
In the non-coprime case the answer is much more complicated. See ["Rational Dyck Paths in the Non Relatively Prime Case"](https://doi.org/10.37236/6901) by Gorsky, Mazin, and Vazirani. They explain that it is a result of Bizley that
$$ \sum\_{d\geq 0} C(da,db)z^d = \mathrm{exp}\left(\sum\_{d\geq 1} \frac{1}{d(a+b)}\binom{d(a+b)}{da}z^d \right) $$
for coprime $a, b$, which is the best it seems one can do.


The paper of Bizley is: <https://doi.org/10.1017/S002026810005424X>.


