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$.
Don’t caring about validity of artithemtic transformations of (by the way, probably absolutely divergent) products, we can “prove” the required equality as follows.
Put $$P’=\frac{1}{\prod_{n=2}^{\infty}\left( 1\color{red}- \frac{(-1)^{\frac{p_n-1}{2}}}{p_n}\right)}.$$
According to Donald Splutterwit’s answer, $P’=\frac {\pi}4$. But
$$PP’=\frac{1}{\prod_{n=2}^{\infty}\left( 1 - \frac{1}{p^2_n}\right)}.$$
When we expand each of multipliers in a geometric series and multiply out, we obtain a series $S=\sum_{k=0}^\infty \frac 1{(2k+1)^2}$. It is well-known that $S’=\sum_{k=1}^\infty \frac 1{k^2}=\frac{\pi^2}{6}$, so $S=S’-\frac {1}4 S’=\frac{\pi^2}{8}$. Thus $P=\frac S{P’}=\frac{\pi}2$.