# Why is \frac{\pi}{4} = \frac{1}{1} – \frac{1}{3} + \frac{1}{5} – \frac{1}{7} + \cdots = \sum_{i = 0}^{\infty} (-1)^i \cdot \frac{1}{2i + …

Here's a sketch of a half-geometric argument I heard a while back.

First, notice that πr 2   \pi r^2  is approximately equal to the number of lattice points inside the circle of radius r, i.e., the number of pairs (x, y) such that x 2 +y 2 ≤r 2   x^2 + y^2 \le r^2 .

The number of these lattice points is equivalently the sum over n≤r 2   n \le r^2  of the number of ways to express n as a sum of two squares.

By some number-theoretic magic, the number of ways to express n as a sum of squares of two positive integers is (# divisors of n congruent to 1 mod 4) – (# divisors of n congruent to 3 mod 4). Multiplying by 4 gives the number of ways to express n as a sum of squares using all four quadrants.
(This result appears as Corollary 3.23 in my copy of Niven, Zuckerman, and Montgomery's number theory text. To get some partial intuition, recall that Fermat's Two-Squares Theorem says that an odd prime number is expressible as a sum of two squares iff it is congruent to 1 mod 4.)

But Sum(# divisors of n≤r 2   n \le r^2  congruent to 1 mod 4) = (# times 1 divides n≤r 2   n \le r^2 ) + (# times 5 divides n≤r 2   n \le r^2 ) + … = ⌊r 2 1 ⌋+⌊r 2 5 ⌋+⋯  \lfloor \frac{r^2}{1} \rfloor + \lfloor \frac{r^2}{5} \rfloor + \cdots , and similarly for the 3 mod 4 congruency.

Thus, πr 2 ≈4(⌊r 2 1 ⌋−⌊r 2 3 ⌋+⌊r 2 5 ⌋−⋯)  \pi r^2 \approx 4( \lfloor \frac{r^2}{1} \rfloor – \lfloor \frac{r^2}{3} \rfloor + \lfloor \frac{r^2}{5} \rfloor – \cdots) , and taking this formula asymptotically to get rid of the approximation, and dividing by r 2   r^2 , we get our result.

Here's a sketch of a half-geometric argument I heard a while back.

First, notice that $\pi r^2$ is approximately equal to the number of lattice points inside the circle of radius r, i.e., the number of pairs (x, y) such that $x^2 + y^2 \le r^2$.

The number of these lattice points is equivalently the sum over $n \le r^2$ of the number of ways to express n as a sum of two squares.

By some number-theoretic magic, the number of ways to express n as a sum of squares of two positive integers is (# divisors of n congruent to 1 mod 4) – (# divisors of n congruent to 3 mod 4). Multiplying by 4 gives the number of ways to express n as a sum of squares using all four quadrants.
(This result appears as Corollary 3.23 in my copy of Niven, Zuckerman, and Montgomery's number theory text. To get some partial intuition, recall that Fermat's Two-Squares Theorem says that an odd prime number is expressible as a sum of two squares iff it is congruent to 1 mod 4.)

But Sum(# divisors of $n \le r^2$ congruent to 1 mod 4) = (# times 1 divides $n \le r^2$) + (# times 5 divides $n \le r^2$) + … = $\lfloor \frac{r^2}{1} \rfloor + \lfloor \frac{r^2}{5} \rfloor + \cdots$, and similarly for the 3 mod 4 congruency.

Thus, $\pi r^2 \approx 4( \lfloor \frac{r^2}{1} \rfloor – \lfloor \frac{r^2}{3} \rfloor + \lfloor \frac{r^2}{5} \rfloor – \cdots)$, and taking this formula asymptotically to get rid of the approximation, and dividing by $r^2$, we get our result.

Why is \frac{\pi}{4} = \frac{1}{1} – \frac{1}{3} + \frac{1}{5} – \frac{1}{7} + \cdots = \sum_{i = 0}^{\infty} (-1)^i \cdot \frac{1}{2i + …