Seeking an elegant proof that these two infinite series are equal Recently I encountered this equality in my work:
\begin{align*}
    &\bigg( 1+\frac{1}{p-1} \bigg)
    \bigg( 1+\frac{1}{p^2-1} \bigg)
    \bigg( 1+\frac{1}{p^3-1} \bigg)
    \cdots\\
    =\quad&
    1+\frac{1}{p-1}\bigg(1+\frac{1}{p-1}\bigg(1+\frac{1}{p^2-1}\bigg(1+\frac{1}{p^2-1}\bigg(1+\frac{1}{p^3-1}\bigg(1+\frac{1}{p^3-1}\bigg(1+\cdots\bigg)
\end{align*}
If $p$ is a real number $\geq 2$, it can be easily checked by showing that the ratio of L.H.S and R.H.S tends to $1$. However, this is not the type of proof I wished for.
I'm seeking for a more elegant proof, that would also work for the case in which $p$ is a complex number. For example, is there any way to find the analytical continuation of it? Also, is there any reference for this equality? I believe there are more of this kind in the literature.
 A: This holds for $p\in\mathbb{C}$ with $|p|>1$. After opening the "additive" parentheses on the RHS: $$1+a_1(1+a_1(1+a_2(1+a_2(1+\ldots))))=\sum_{n=1}^\infty(1+a_n)\prod_{k=1}^{n-1}a_k^2,$$ if we put $p=1/q$ (thus $|q|<1$) and use the $q$-Pochhammer symbol, this is rewritten as $$\color{blue}{\frac{1}{(q;q)_\infty}=\sum_{n=1}^\infty\frac{1-q^n}{(q;q)_n^2}q^{n(n-1)}},\qquad(a;q)_n:=\prod_{k=0}^{n-1}(1-aq^k).$$ So this is an instance of $q$-series, known to Heine (maybe earlier, as far as back to Euler).

Then, the following lines of reasoning look most natural (if not elegant) to me. (I see it in many texts on $q$-stuff; the results below are taken from The Theory of Partitions by G. E. Andrews).

(Cauchy) For $|q|,|z|<1$ we have $\displaystyle\frac{(az;q)_\infty}{(z;q)_\infty}=\sum_{n=0}^\infty\frac{(a;q)_n}{(q;q)_n}z^n$.

To show this, let $f(z)=(az;q)_\infty/(z;q)_\infty$; then $(1-z)f(z)=(1-az)f(qz)$, and $f(z)$ is analytic on $|z|<1$. If we put $f(z)=\sum_{n=0}^\infty f_n z^n$ here, we get $f_n-f_{n-1}=q^n f_n-aq^{n-1}f_{n-1}$. Together with the obvious $f_0=1$, this gives $f_n=(a;q)_n/(q;q)_n$ as to be shown.
In the sequel, let's omit the "$;q$" and write simply $(a)_n:=(a;q)_n$.

(Heine) For $|q|,|z|,|b|<1$ we have $\displaystyle\sum_{n=0}^\infty\frac{(a)_n(b)_n}{(q)_n(c)_n}z^n=\frac{(b)_\infty(az)_\infty}{(c)_\infty(z)_\infty}\sum_{n=0}^\infty\frac{(c/b)_n(z)_n}{(q)_n(az)_n}b^n$.

This is shown using $(a)_n=(a)_\infty/(aq^n)_\infty$ and the above result by Cauchy: $$\text{LHS}=\frac{(b)_\infty}{(c)_\infty}\sum_{n=0}^\infty\frac{(a)_n(cq^n)_\infty}{(q)_n(bq^n)_\infty}z^n=\frac{(b)_\infty}{(c)_\infty}\sum_{n=0}^\infty\frac{(a)_n}{(q)_n}z^n\sum_{m=0}^\infty\frac{(c/b)_m}{(q)_m}(bq^n)^m\\=\frac{(b)_\infty}{(c)_\infty}\sum_{m=0}^\infty\frac{(c/b)_m}{(q)_m}b^m\sum_{n=0}^\infty\frac{(a)_n}{(q)_n}(zq^m)^n=\frac{(b)_\infty}{(c)_\infty}\sum_{m=0}^\infty\frac{(c/b)_m(azq^m)_\infty}{(q)_m(zq^m)_\infty}b^m=\text{RHS}.$$

(Heine) For $|q|<1$ and $|c|<|ab|$ we have $\displaystyle\sum_{n=0}^\infty\frac{(a)_n(b)_n}{(q)_n(c)_n}\left(\frac{c}{ab}\right)^n=\frac{(c/a)_\infty(c/b)_\infty}{(c)_\infty(c/(ab))_\infty}$.

Here the idea is to put $z=c/(ab)$ above (and extend analytically to cover the premises).

If we replace $(a,b,c)$ by $(1/a,1/b,z)$ in the last result, and take $a,b\to 0$, we get $$\sum_{n=0}^\infty\frac{q^{n(n-1)}z^n}{(q)_n(z)_n}=\frac{1}{(z)_\infty}$$ (also known to Cauchy). Multiply by $1-z$ and take $z\to 1$ to get (out of) the $\color{blue}{\text{blue}}$.
A: This is just a small supplement to the instructive answer from @metamorphy. I couldn't see his argument in the last line at a glance and needed some intermediate steps to fully appreciate his solution. Maybe some others are interested too.
We obtain from the right-hand side of (1)
\begin{align*}
\sum_{n=0}^\infty\frac{q^{n(n-1)}z^n}{(q)_n(z)_n}=\frac{1}{(z)_\infty}\tag{1}
\end{align*}
by multiplying by $1-z$ and taking the limit $z\to 1$:

\begin{align*}
\lim_{z\to 1}\frac{1-z}{(z)_\infty}
&=\lim_{z\to 1}\frac{1-z}{\prod_{n=0}^\infty\left(1-zq^n\right)}\\
&=\lim_{z\to 1}\frac{1}{\prod_{n=1}^\infty\left(1-zq^n\right)}\\
&=\frac{1}{\prod_{n=1}^\infty\left(1-q^n\right)}=\frac{1}{\prod_{n=0}^\infty\left(1-q^{n+1}\right)}\\
&\,\,\color{blue}{=\frac{1}{(q)_{\infty}}}
\end{align*}

and the left-hand side gives

\begin{align*}
\lim_{z\to 1}&(1-z)\sum_{n=0}^\infty\frac{q^{n(n-1)}z^n}{(q)_n(z)_n}\\
&=\lim_{z\to 1}(1-z)\sum_{n=0}^\infty
\frac{q^{n(n-1)}z^n}{\prod_{k=0}^{n-1}\left(1-q^{k+1}\right)\prod_{k=0}^{n-1}\left(1-zq^k\right)}\\
&=\lim_{z\to 1}\sum_{n=0}^\infty
\frac{q^{n(n-1)}z^n}{\prod_{k=0}^{n-1}\left(1-q^{k+1}\right)\prod_{k=1}^{n-1}\left(1-zq^k\right)}\\
&=\sum_{n=0}^\infty
\frac{q^{n(n-1)}z^n}{\prod_{k=0}^{n-1}\left(1-q^{k+1}\right)\prod_{k=1}^{n-1}\left(1-q^k\right)}\\
&=\sum_{n=0}^\infty
\frac{q^{n(n-1)}}{\prod_{k=0}^{n-1}\left(1-q^{k+1}\right)\prod_{k=0}^{n-2}\left(1-q^{k+1}\right)}\\
&=\sum_{n=0}^\infty
\frac{\left(1-q^n\right)q^{n(n-1)}}{\prod_{k=0}^{n-1}\left(1-q^{k+1}\right)\prod_{k=0}^{n-1}\left(1-q^{k+1}\right)}\\
&\,\,\color{blue}{=\sum_{n=0}^\infty\frac{\left(1-q^n\right)q^{n(n-1)}}{(q)_{n}^2}}
\end{align*}

showing the validity of OP's identity for $q:=\frac{1}{p}$ with $|q|<1$
\begin{align*}
\color{blue}{\frac{1}{(q)_{\infty}}=\sum_{n=0}^\infty\frac{\left(1-q^n\right)q^{n(n-1)}}{(q)_{n}^2}}
\end{align*}
