1. Home
  2. Explore
  3. Mathematics
  4. Pi, Primes, and Complex Numbers

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Pi, Primes, and Complex Numbers

Speaker 1Speaker 2

Pi, Primes, and Complex Numbers

5:16
0:00-5:16
  1. Corey

    I have been excited about this one for a while. We are going to find a famous formula for π that looks like 4 times the alternating sum of odd reciprocals: 1 minus 1/3 plus 1/5 minus 1/7 and so on. There is a short calculus proof, but it hides the real story. The path we are taking will reveal the circle hidden behind it, and it involves prime numbers, complex numbers, and a function called chi.

  2. Maria

    A formula for π from an alternating sum of odd numbers? That’s neat, but where does the circle come in? You mentioned lattice points—points with integer coordinates in the plane.

  3. Corey

    Exactly. Draw a big circle centered at the origin. The number of lattice points inside it is approximately the area, πr². For a huge radius, that estimate is very accurate. So if we can count those lattice points in another way, we get another expression for π.

  4. Maria

    So we need to count how many integer pairs (a,b) satisfy a² + b² ≤ r². That’s a classic circle counting problem. But the pattern for how many points lie at each exact distance √n seems chaotic. How do we tame that?

  5. Corey

    That’s where complex numbers come in. Think of each lattice point (a,b) as the Gaussian integer a + bi. The distance squared is a² + b², which is the product of a+bi and its conjugate a-bi. So counting points at distance √n is the same as counting Gaussian integers whose norm is n.

  6. Maria

    Okay, so we’re counting factorizations of n in the Gaussian integers. But factorization only becomes systematic if we know how ordinary primes behave in that system.

  7. Corey

    Right. And here’s the key pattern: a prime p that is 1 mod 4, like 5 or 13, can be factored into two distinct Gaussian primes that are conjugates: p = (a+bi)(a-bi). But a prime p that is 3 mod 4, like 3 or 7, stays prime even in the Gaussian integers—it cannot be split. The prime 2 is special: it factors as (1+i)(1-i), but those two are essentially the same up to multiplication by i.

  8. Maria

    That explains why some distances never hit lattice points. For instance, √3 misses everything because 3 is a 3-mod-4 prime. But how do we count the points when the number has several prime factors, like 25 = 5²?

  9. Corey

    There is a recipe. Factor n into ordinary primes, then split each 1-mod-4 prime into its Gaussian conjugate pair. Then you arrange those Gaussian primes into two columns—left and right—so that each pair is balanced. The product of the left column gives a Gaussian integer whose norm is n, and different arrangements yield different lattice points. For each 1-mod-4 prime with exponent k, you have k+1 choices for how many copies go in the left column. For each 3-mod-4 prime, you need an even exponent, otherwise you get zero points. And factors of 2 don’t affect the count because flipping them just rotates the output by a multiple of 90°, which we account for separately.

  10. Maria

    That final multiplication by 1, i, –1, –i gives the four rotations. So for n = 5³ = 125, the exponent is 3, giving 3+1 = 4 choices from the 5’s, times 4 rotations = 16 points. And indeed, the circle of radius √125 hits exactly 16 lattice points. I can see how this works, but the recipe depends on the prime factorization, which seems messy to sum over all n up to r².

  11. Corey

    That’s where the function χ comes in. Define χ(n) as 1 if n ≡ 1 mod 4, –1 if n ≡ 3 mod 4, and 0 if n is even. This function is multiplicative: χ(ab) = χ(a)χ(b). Now, instead of counting choices per prime, you can write the number of lattice points at distance √n as 4 times the sum of χ(d) over all divisors d of n. For example, for n = 45 = 3²·5, the sum over divisors χ(1)+χ(3)+χ(5)+χ(9)+χ(15)+χ(45) = 1–1+1+1–1+1 = 2, times 4 gives 8 lattice points. And it works because χ is multiplicative.

  12. Maria

    Beautiful—so each row in our table of n from 1 to r² contributes 4 times the sum of χ over its divisors. But adding up all those rows still looks complicated.

  13. Corey

    Here is the clever switch: instead of summing over each n, sum over each divisor d. For a fixed d, how many numbers n ≤ r² are divisible by d? Roughly r²/d. So the total number of lattice points inside the circle is approximately 4 times r² times the sum over d of χ(d)/d. The bigger r gets, the better this approximation. And since χ(d) is zero for even d and alternates 1, –1, –1, 1 for odd d, that sum becomes 1 – 1/3 + 1/5 – 1/7 + … .

  14. Maria

    So the total count of lattice points is about 4r² times that alternating sum. But we also know it’s about πr². Equating them gives π = 4 times (1 – 1/3 + 1/5 – 1/7 + …). That’s the formula! And the whole derivation rested on the regular way primes behave in the Gaussian integers—primes 1 mod 4 split, primes 3 mod 4 don’t.

  15. Corey

    Exactly. That regularity is what turned a seemingly chaotic divisor sum into a simple pattern. It’s a wonderful intersection of algebraic and analytic number theory. And now you see where the circle was hiding all along: in the geometry of lattice points and the arithmetic of Gaussian integers.

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent