An $n$-Dyck path (or a Catalan path) is a lattice path $P$, unit East and North steps, in an $n\times n$ square grid which stays (weakly) above the main diagonal. Let $\square\_n$ denote all such paths. Define the **area of a path** $P$ to be the number of full squares below the path and above the diagonal. Then one variant of a $q$-Catalan number is in the form
$$C\_n(q)=\sum\_{P\in\square\_n}q^{area(P)}.$$
A few examples: $C\_1(q)=1,\, C\_2(q)=1+q,\, C\_3(q)=1+2q+q^2+q^3$.


There is this notion of [$q,t$-Catalan numbers](http://garsia.math.yorku.ca/MPWP/qtanalogs/catalan/) so that $C\_n(q)=C\_n(q,1)$. 


I'm finding (after some fooling around) the following generating function which I've not encountered in the literature.



> 
> **Question.** Is this known or can you provide a proof?
>  $$\sum\_{n=0}^{\infty}C\_n(q)\,z^n
> =\frac{\sum\_{k=0}^{\infty}q^{k^2}\prod\_{j=1}^k\frac{z}{q^j-1}}
> {{\sum\_{k=0}^{\infty}q^{k(k-1)}\prod\_{j=1}^k\frac{z}{q^j-1}}}$$
> 
> 
> 



generating $q$-Catalan numbers
The functions
$$
C\_n(q)=\sum\_{P\in\square\_n}q^{area(P)}
$$
satisfy the following recurrence relation
$$
C\_n(q)=\sum\_{k=1}^nq^{k-1}C\_{k-1}(q)C\_{n-k}(q).\tag{1}
$$
*Proof.*
(taken from the book ["The q, t-Catalan Numbers and the Space of Diagonal Harmonics" by J. Haglund](https://www.math.upenn.edu/~jhaglund/books/qtcat.pdf), page 14, typo corrected)


We break up our path $P$ according to the “point of first return” to the line y = x. If this occurs at (k, k), then the area of the part of $P$ from (0, 1) to (k − 1, k), when viewed as an element of $\square\_{k-1}$, is
$k − 1$ less than the area of this portion of $P$ when viewed as a path in $\square\_{n}$.$\qquad\qquad\qquad~~~~~\Box$


The generating function
$$
G(z,q)=\sum\_{n=0}^\infty C\_n(q)z^n
$$
satisfies the functional equation, which is a direct consequence of $(1)$:
$$
G(z,q)-1=zG(z,q)G(qz,q).
$$
We rewrite it for convenience as 
$$
\frac{1}{G(z,q)}=1-zG(qz,q).\tag{2}
$$
It is known that the generalized [Rogers-Ramanijan continued fraction](http://mathworld.wolfram.com/Rogers-RamanujanContinuedFraction.html), formula (39),
$$
F(a,q)=\frac{\sum\_{k=0}^\infty\frac{(-a)^kq^{k^2}}{(q;q)\_k}}{\sum\_{k=0}^\infty\frac{(-a)^kq^{k^2+k}}{(q;q)\_k}}=1-\cfrac{aq}{1-\cfrac{aq^2}{1-\cfrac{aq^3}{1-...}}},
$$
satisfies the functional equation
$$
F(a,q)=1-\frac{aq}{F(aq,q)}.\tag{3}
$$
Since $G(0,q)=F(0,q)=1$ it is clear from comparing $(2)$ and $(3)$ that 
$$
\frac{1}{G(z,q)}=F(z/q,q)=\frac{\sum\_{k=0}^\infty\frac{(-z)^kq^{k^2-k}}{(q;q)\_k}}{\sum\_{k=0}^\infty\frac{(-z)^kq^{k^2}}{(q;q)\_k}},
$$
as required.


