$ \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)

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.


Your product is nothing but $$\lim_{n \to \infty}\prod_{\overset{p_k \leq n}{p_k \equiv -1 \pmod4}} \left(1+\dfrac1{p_k}\right)^{-1} \prod_{\overset{p_k \leq n}{p_k \equiv 1 \pmod4}} \left(1-\dfrac1{p_k}\right)^{-1}$$ Now recall that $$\left(1-\dfrac1r\right)^{-1} = \sum_{k=0}^{\infty} \dfrac1{r^k}$$ Make use of the above to note that $$\lim_{n \to \infty}\prod_{\overset{p_k \leq n}{p_k \equiv -1 \pmod4}} \left(1+\dfrac1{p_k}\right)^{-1} \prod_{\overset{p_k \leq n}{p_k \equiv 1 \pmod4}} \left(1-\dfrac1{p_k}\right)^{-1} = \lim_{m \to \infty} \sum_{\ell=0}^m \dfrac{(-1)^\ell}{2\ell+1} = \dfrac{\pi}4$$ The last step makes use of the fact that $$4\ell+1 = \prod_{\overset{q_k \equiv 1 \pmod4}{k=1,2,\ldots,n_1}} q_k^{a_k} \prod_{\overset{p_j \equiv -1 \pmod4}{j=1,2,\ldots,n_2}} p_j^{b_j}$$ such that $\displaystyle \sum_{j=1}^{n_2}b_j = \text{even}$ and $$4\ell-1 = \prod_{\overset{q_k \equiv 1 \pmod4}{k=1,2,\ldots,n_1}} q_k^{a_k} \prod_{\overset{p_j \equiv -1 \pmod4}{j=1,2,\ldots,n_2}} p_j^{b_j}$$ such that $\displaystyle \sum_{j=1}^{n_2}b_j = \text{odd}$.


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:

  1. 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}$$

  2. 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$.

  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}.$$


Let $L(s,\chi)$ be the $L$ function for the non principal modulo $4$ Dirichlet character

$$\frac{\pi}{4}=L(1,\chi)=\prod_{p}\frac{p}{p-\chi(p)}=\prod_{p\equiv 1 \text{mod 4}}\frac{p}{p-1}\prod_{p\equiv 3 \text{mod 4}}\frac{p}{p+1}$$