Pi hiding in prime regularities
Based on 3Blue1Brown's video on YouTube. If you like this content, support the original creators by watching, liking and subscribing to their content.
Rewriting lattice points (a,b) as Gaussian integers a+bi turns a²+b²=n into z·conj(z)=n, converting geometry into factoring.
Briefing
A hidden arithmetic regularity—how primes split inside the Gaussian integers—turns a messy lattice-point counting problem into a clean alternating series for π. The key move is to count integer grid points inside a large circle in two ways: geometrically, the count is about πr², but algebraically it can be expressed through which integers can be written as a sum of two squares. Once that algebraic count is reorganized using a special multiplicative function tied to primes mod 4, the circle’s area forces π to equal a simple alternating infinite sum.
The setup begins with lattice points (a,b) with integers a and b. Points at distance √n from the origin correspond exactly to solutions of a²+b²=n. Translating (a,b) into the complex number a+bi reframes the condition as (a+bi)(a−bi)=n, so the problem becomes one of factoring n inside the ring of Gaussian integers. In that ring, primes behave in a structured way: primes congruent to 1 mod 4 (like 5, 13, 17) split into two distinct Gaussian primes, while primes congruent to 3 mod 4 (like 3, 7, 11) remain “unsplittable” even after allowing i. This splitting/non-splitting dichotomy decides whether a given n has any representation as a²+b² and, if it does, how many lattice points lie on the circle of radius √n.
From there, the counting becomes a combinatorics-of-factorization recipe. For each prime power dividing n, the number of ways to distribute Gaussian prime factors between two conjugate columns determines the number of lattice points on the circle. A factor of 2 is special but ultimately doesn’t change the count: powers of 2 contribute no net increase because swapping conjugate Gaussian primes only rotates the final complex number by multiples of 90 degrees.
To package the prime-power rules efficiently, the argument introduces a function χ on natural numbers. It is defined so that χ(p)=1 when p≡1 (mod 4), χ(p)=−1 when p≡3 (mod 4), and χ(n)=0 for even n. χ is multiplicative, meaning χ(ab)=χ(a)χ(b), which allows the lattice-point count for radius √n to be written as 4 times a sum of χ over all divisors of n. When lattice points inside a circle of radius r are counted by summing over all n up to r², the divisor-sum structure can be reorganized by columns: for large r, the contribution from each divisor d is roughly proportional to r²/d. This collapses into the alternating series 1−1/3+1/5−1/7+… .
Since the geometric count of lattice points inside the circle is πr² up to smaller error, dividing by r² and letting r grow forces that alternating series to converge to π. The result is a rare bridge between geometry, complex multiplication, and prime factorization—showing that π emerges from the same mod-4 regularity that governs which primes split in the Gaussian integers.
Cornell Notes
Counting lattice points inside a circle leads to representations of integers as a²+b². Rewriting a+bi as a Gaussian integer turns a²+b²=n into (a+bi)(a−bi)=n, so the circle problem becomes a factoring problem in the Gaussian integers. Prime factorization there follows a mod-4 rule: primes p≡1 (mod 4) split into two Gaussian primes, while primes p≡3 (mod 4) stay prime; this determines whether and how many lattice points occur on the circle of radius √n. A multiplicative function χ encodes this splitting behavior, letting the number of lattice points on radius √n be written as 4 times a divisor-sum of χ. Summing over n≤r² and comparing with the geometric estimate πr² yields π=1−1/3+1/5−1/7+… .
Why does counting lattice points on a circle reduce to factoring in the Gaussian integers?
What mod-4 rule for primes controls whether a circle hits lattice points?
How does the counting recipe work for a specific n like 25 or 125?
What role does the function χ play, and why is multiplicativity crucial?
How does summing over divisors turn the lattice-point count into the alternating π series?
Review Questions
- How does the condition a²+b²=n translate into a Gaussian-integer factoring problem, and what does the conjugate accomplish?
- Why do primes p≡1 (mod 4) and p≡3 (mod 4) lead to opposite outcomes for whether √p circles contain lattice points?
- What does multiplicativity of χ allow you to do when computing the lattice-point count from prime powers?
Key Points
- 1
Rewriting lattice points (a,b) as Gaussian integers a+bi turns a²+b²=n into z·conj(z)=n, converting geometry into factoring.
- 2
In the Gaussian integers, primes p≡1 (mod 4) split into two distinct Gaussian primes, while primes p≡3 (mod 4) remain Gaussian primes.
- 3
The splitting behavior determines both whether a circle of radius √n hits lattice points and how many points appear on that circle.
- 4
A multiplicative function χ encodes the mod-4 prime behavior: χ(p)=1 for p≡1 (mod 4), χ(p)=−1 for p≡3 (mod 4), and χ(even)=0.
- 5
The lattice-point count on radius √n can be expressed as 4 times a divisor-sum of χ over all divisors of n.
- 6
Summing over n≤r² and comparing with the geometric estimate πr² forces π to equal the alternating series 1−1/3+1/5−1/7+… .
- 7
Powers of 2 do not change the lattice-point counts in this framework because their Gaussian prime contributions only produce rotational redundancy.