Number Theory Introduction


Number Theory Introduction

Michael
Welcome to this episode on number theory! Today we're diving into a subject that Gauss called the queen of mathematics. It's all about the ordinary counting numbers and their properties.

Maria
And we're launching a very short introduction book on it. But Michael, what exactly is number theory? Is it just about numbers that are odd or even?

Michael
That's part of it, but it goes much deeper. It studies primes, perfect squares, and even connections to geometry and cryptography. The building blocks are primes, which are numbers whose only factors are 1 and themselves.

Maria
Primes like 11, 13, 17, 19. But I remember Euclid proved there are infinitely many primes. How did he do that?

Michael
Euclid used a clever geometric argument. He assumed you have a finite list of all primes, then multiplied them together and added 1. That new number isn't divisible by any prime on your list, so it must either be prime itself or have a prime factor not in the list. This contradiction shows the list can never be complete.

Maria
So there's no largest prime. But can we say anything about primes of specific forms, like primes that are one more than a multiple of 4?

Michael
Yes, Dirichlet proved that there are infinitely many primes of the form an + b, as long as a and b have no common factors. For example, there are infinitely many primes ending in 1, 3, 7, or 9. That result was a huge breakthrough.

Maria
What about Mersenne primes? Those are numbers like 2^n - 1, right?

Michael
Exactly. Mersenne primes are primes of that form, like 3, 7, 31. They're interesting because the largest known primes are usually Mersenne primes. And they also connect to perfect numbers, which are numbers equal to the sum of their proper divisors, like 6 and 28.

Maria
Euclid gave a formula for even perfect numbers: they're 2^(n-1) times (2^n - 1) when the second factor is prime. And Euler proved that every even perfect number is of that type. But are there any odd perfect numbers?

Michael
Nobody knows. If any exist, they'd be huge—over 10^1500. Most mathematicians suspect none exist, but it's still an open problem.

Maria
Let's talk about Fermat primes. Those are numbers of the form 2^(2^n) + 1, like 3, 5, 17. Fermat thought they were all prime, but Euler showed that 2^32 + 1 is divisible by 641.

Michael
And since then, no other Fermat numbers have been found prime. They do show up in an unexpected place, though: constructing regular polygons with ruler and compass. Gauss proved that a regular n-gon can be constructed only if n is a power of 2 times distinct Fermat primes.

Maria
So that's why we can construct a 17-gon but not a 100-gon. Now, what about perfect squares? I recall that no square ends in 2, 3, 7, or 8.

Michael
Right, and there's a nice pattern: the sum of the first n odd numbers equals n squared. You can see it geometrically with L-shaped arrays of dots. Also, every square is either a multiple of 4 or one more than a multiple of 4.

Maria
That explains why numbers made entirely of ones can't be squares, because they're all 3 mod 4. Perfect squares also show up in Pythagorean triples—right triangles with integer sides.

Michael
Exactly. For a primitive triple where a is odd and b even, we have a = x^2 - y^2, b = 2xy, c = x^2 + y^2, with x and y coprime and of opposite parity. That gives us all such triangles.

Maria
So for side length 29, we found two triangles: (20, 21, 29) and (29, 420, 421). How do we know those are the only ones?

Michael
Using the formulas and the fact that 29 is prime, we deduce that 29 must be either c or a. Solving gives exactly those two. Fermat also studied sums of two squares: every prime of the form 4n+1 can be written uniquely as a sum of two squares.

Maria
And then there's Fermat's Last Theorem, which says that a^n + b^n = c^n has no positive integer solutions for n > 2. Fermat claimed a proof but it was only proven by Andrew Wiles in 1995.

Michael
Yes, using deep modern mathematics. Now let's switch gears to modular arithmetic, which Gauss formalized. It's like clock arithmetic: 9 plus 6 equals 3 mod 12.

Maria
And we can use it to find days of the week. Charles Dodgson, aka Lewis Carroll, devised a method using four numbers: century, year, month, and day, all added mod 7.

Michael
For September 28, 2020, we got a total of 50, which mod 7 is 1, meaning Monday. And we can find years with five Sundays in February: it happens in leap years when Feb 1 is Sunday, which occurred in 2004, 2032, 2060, and 2088.

Maria
That's neat. Now, Fermat's little theorem says that a^p - a is always divisible by a prime p. Can you prove that without algebra?

Michael
One nice proof uses necklaces: with p beads and a colors, the number of distinct necklaces using at least two colors is (a^p - a)/p, which must be an integer. So a^p - a is divisible by p.

Maria
And that theorem helps with card shuffling! For a 52-card pack, after one riffle shuffle, a card in position x moves to 2x mod 53.

Michael
Right. After n shuffles, it goes to 2^n x mod 53. For the deck to return to order, we need 2^n ≡ 1 mod 53. By Fermat's theorem, 2^52 ≡ 1 mod 53, and 52 is the smallest such exponent, so 52 shuffles restore the deck.

Maria
But with two jokers, we have 54 cards, so mod 55. Since 55 isn't prime, we can't use Fermat directly.

Michael
Exactly. But 55 = 5 × 11. We apply Fermat to each: 2^4 ≡ 1 mod 5 and 2^10 ≡ 1 mod 11. By raising to appropriate powers, we get 2^20 ≡ 1 mod 55. And 20 is the smallest such number, so 20 shuffles suffice.

Maria
That's clever. Euler generalized Fermat's theorem to composite moduli using the totient function φ(n), which counts numbers coprime to n. For prime p, φ(p) = p-1.

Michael
And for n = pq with distinct primes, φ(pq) = (p-1)(q-1). Euler's theorem says a^φ(n) ≡ 1 mod n when a and n are coprime. This is the foundation of RSA cryptography.

Maria
So that's how credit card numbers are kept secure! Bob picks two large primes p and q, computes N = pq and φ(N), then chooses an encryption exponent e. He publishes N and e, but keeps p and q secret.

Michael
Alice encrypts her message M by computing M^e mod N. Bob, knowing the secret key d such that e*d ≡ 1 mod φ(N), decrypts by computing (M^e)^d ≡ M mod N. Without knowing the factors, it's computationally infeasible to find d.

Maria
So number theory, once a purely abstract field, now protects our online transactions. That's a perfect example of how pure mathematics finds unexpected applications.

Michael
Indeed. From Euclid's primes to RSA, number theory is as relevant today as ever. If you want to explore more, the book 'Number Theory: A Very Short Introduction' covers all these topics and more.

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