TITLE: $ \frac{\pi}{4} = \frac{3}{4} \times \frac{5}{4} \times \frac{7}{8} \times \frac{11}{12} \times \cdots$ (just primes in the numerator)
QUESTION [12 upvotes]: How to prove the following equality?
$$ \frac{\pi}{4} = \frac{3}{4} \times \frac{5}{4} \times \frac{7}{8} \times \frac{11}{12} \times \frac{13}{12} \times \frac{17}{16} \times \frac{19}{20} \times \frac{23}{24} \times \frac{29}{28} \times \frac{31}{32} \times \cdots$$
I've seen this formula on Wikipedia.
The numerators are the odd primes; each denominator is the multiple of four nearest to the numerator.
Thanks.

REPLY [3 votes]: As I mentioned in my comment yesterday, this question is very similar to this one, except that here we want to prove the identity 
\begin{align*}
\dfrac{\pi}{4}=\prod_{k=2}^{\infty}\left(1+\dfrac{(-1)^{\frac{p_{{k}}+1}{2}}}{p_{k}} \right )^{-1},
\end{align*}
which turns out to be even simpler.
So I almost literally reproduce the relevant half of my previous solution:

Decompose the product on the right as 
$$B=\prod_{\text{primes}\; p\\ \text{ of  the  form }4k+1}\left(1-\frac{1}{p}\right)^{-1}\prod_{\text{primes}\; p\\ \text{ of  the  form }4k+3}\left(1+\frac{1}{p}\right)^{-1}.\tag{1}$$
Consider an odd integer $n=2m+1$. It is easy to understand that if primes of the form $4k+3$ appear in its prime number decomposition an even number of times, then $n$ is of the form $4K+1$ [since $(4k_1+3)(4k_2+3)=1\; \mathrm{mod}\;4$]. If the number of such appearances is odd, then $n$ is of the form $4K+3$.
Rewrite (1) (expanding its factors into geometric series) as
$$B=\sum_{m=0}^{\infty}\frac{(-1)^{r(m)}}{2m+1}$$
where $r(m)$ counts the number of appearances of primes of the form $4k+3$ in the decomposition of $2m+1$. But then Step 2 allows to write $(-1)^{r(m)}=(-1)^m$, so that 
$$ B=\sum_{m=0}^{\infty}\frac{(-1)^{m}}{2m+1}=\frac{\pi}{4}.$$