Is there a proof for Euler’s “other” formula for pi

euler-productpiprime numbersreference-request

Some context: The webpage Pi Formulas on Wolfram.com has a list of some well-known formulas for $\pi$. However, there is a formula, as stated below, which I can't find a proof for.

$$\pi = \frac{2}{\prod_{n=2}^{\infty}( 1 + \frac{(-1)^{\frac{p_n-1}{2}}}{p_n})} =\frac{2}{\prod_{n=1}^{\infty}( 1 + \frac{\sin(\frac{\pi}{2}p_n)}{p_n})}$$

where $p_n$ is the $n$-th prime number. Wolfram references a book called The Joy of Pi by David Blatner. The book states the formula, but never proves it nor leaves a reference. Apart from these two sources, my efforts to find a proof have been in vain. I checked via Python whether this equality was correct or not, and it is correct (as far as Python can verify).

My question: Does anyone know where a proof for this equality is somewhere in the Mathematical literature? If so, I would appreciate the proof being shown in an answer.

Edit: After much deliberation, I have discovered that Dirichlet Series representation of the Lebinez formula was not the answer to this problem. The famous Lebinez formula for $\pi$ is
$$\sum_{k=0}^{\infty} \frac{(-1)^{k}}{2k+1} = \frac{\pi}{4}.$$
The Dirichlet Series representation is
$$\prod_{p \equiv 1 \text{ (mod }4)}\left(\frac{p}{p-1}\right)\prod_{p \equiv 3 \text{ (mod }4)}\left(\frac{p}{p+1}\right).$$
Whilst initially this looked like the answer, upon review, I realized my error.
By expanding out our original formula divided by 2, we get
$$\frac{1}{\prod_{n=2}^{\infty}(1+\frac{(-1)^{\frac{p_n-1}{2}}}{p_n})} = (1-\frac{1}{3})^{-1}(1+\frac{1}{5})^{-1}(1-\frac{1}{7})^{-1}(1-\frac{1}{11})^{-1}\cdots$$
$$=\prod_{p \equiv 3 \text{ (mod }4)}\left(\frac{p}{p-1}\right)\prod_{p \equiv 1 \text{ (mod }4)}\left(\frac{p}{p+1}\right).$$
Notice that
$$\frac{1}{1 + \frac{(-1)^{\frac{p-1}{2}}}{p}} = \begin{cases}
\frac{p}{p+1}, & \text{if } p \equiv 1 \text{ (mod }4) \\
\frac{p}{p-1}, & \text{if } p \equiv 3 \text{ (mod }4) \\
\end{cases}
\neq
\begin{cases}
\frac{p}{p-1}, & \text{if } p \equiv 1 \text{ (mod }4) \\
\frac{p}{p+1}, & \text{if } p \equiv 3 \text{ (mod }4) \\
\end{cases}.$$

While the two products are very similar, they are NOT the same. So the question remains, where's the proof? I would imagine that one could prove Euler's "other" formula for $\pi$ from Lebinez's formula for $\pi$.

Best Answer

We have \begin{eqnarray*} P&=&\frac{1}{\prod_{n=2}^{\infty}\left( 1 + \frac{(-1)^{\frac{p_n-1}{2}}}{p_n}\right)} \\ &=& \left(1+\frac{1}{3} \right)^{-1} \left(1-\frac{1}{5} \right)^{-1}\left(1+\frac{1}{7} \right)^{-1}\left(1+\frac{1}{11} \right)^{-1} \cdots \end{eqnarray*} Now expand each of these terms geometrically and multiply out. We will get the reciprocal of every odd number exactly once and with a minus sign if it is congruent to $3$ mod $4$ and a plus sign if it is $1$ mod $4$.

So we have \begin{eqnarray*} P=1 -\frac{1}{3} +\frac{1}{5} -\frac{1}{7} +\frac{1}{9}-\frac{1}{11} +\frac{1}{13} \cdots = \frac{\pi}{4}. \end{eqnarray*}

Related Question