# How can we prove $\pi =1+\frac{1}{2}+\frac{1}{3}+\frac{1}{4}-\frac{1}{5}+\frac{1}{6}+\frac{1}{7}+\cdots\,$?

I saw the beautiful result that was proved by Euler in Wikipedia but I do not know how it can be proved.

$$\pi =1 + \frac{1}{2} + \frac{1}{3} + \frac{1}{4} - \frac{1}{5} + \frac{1}{6} + \frac{1}{7} + \frac{1}{8} + \frac{1}{9} - \frac{1}{10} + \frac{1}{11} + \frac{1}{12} - \frac{1}{13} + \cdots$$

After the first two terms, the signs are determined as follows: If the denominator is a prime of the form $4m - 1$, the sign is positive; if the denominator is a prime of the form $4m + 1$, the sign is negative; for composite numbers, the sign is equal the product of the signs of its factors.

There is reference in this Wikipedia page to Carl B. Boyer's A History of Mathematics, Chapter 21., p. 488-489. I found the book on the internet but there is no proof in the book.

Thanks a lot for your help.

• See en.wikipedia.org/wiki/…, where $d = -4$. Googling class number formula should give you proofs for this result.
– user27126
Jul 2, 2013 at 7:47
• This formula is beautiful, but its definition is terrible...
– JSCB
Jul 2, 2013 at 8:31
• @ᴊᴀsᴏɴ The definition is from the Wiki link I gave. If you have a better definition please feel free to update it. Jul 2, 2013 at 8:41
• $1+1/2+1/3+1/4-1/5+1/6+1/7+1/8-1/10+1/11+1/12+1/13=2.47$space $lim(1+1/2+1/3+1/4-1/5+1/6+1/7+1/8-1/10+1/11+1/12+1/13)=\pi$ Aug 23, 2013 at 13:42

1. We want to compute $$S=\sum_{m=1}^{\infty}\frac{(-1)^{s(m)}}{m},$$ where $s(m)$ counts the number of appearances of primes of the form $4k+1$ in the prime decomposition of $m$. Note that $$S=\sum_{n=0}^{\infty}\frac{(-1)^{s(2n+1)}}{2n+1}+\frac{S}{2}\quad\Longrightarrow \quad \frac{S}{2}=\sum_{n=0}^{\infty}\frac{(-1)^{s(2n+1)}}{2n+1}.\tag{1}$$

2. But the latter sum can be written as $$\sum_{n=0}^{\infty}\frac{(-1)^{s(2n+1)}}{2n+1}=\prod_{k=2}^{\infty}\left(1+\dfrac{(-1)^{\frac{p_{{k}}-1}{2}}}{p_{k}} \right )^{-1},\tag{2}$$ where the product on the right is taken over odd primes. To show the equality, expand each factor on the right into geometric series and multiply them. Further, as shown by answers to this question, this product is equal to $\pi/2$. Being combined with (1), this gives $S=\pi$.

• Damn,that guy Euler is really good! Jul 13, 2013 at 13:10
• one of the best analysts of all time ! Dec 24, 2013 at 18:35
• who is euler?$~$
– user838035
Dec 8, 2020 at 15:06