 A Latin translation of Diathontus appeared in 1621. Fermat became convinced that studying the properties of the integers might be even more important than studying tangents and areas. He tried to get others interested in what we now call number theory. Fermat's approach was to send intriguing results to his correspondents and hope they expressed interest. One of those correspondents was Marine Marseille, a French minimite friar. Through Marseille, Fermat was put in contact with other French mathematicians including Descartes and Frenicle de Vecille. Unfortunately, Marseille was not above stirring up trouble. One problem in number theory began, and to some extent ended, with Euclid. So remember that Euclid defined a perfect number to be a number equal to the sum of its proper divisors. And in the last proposition of book 9, Euclid proved that if 2 to the power n minus 1 is prime, then 2 to the power n minus 1 times 2 to the power n minus 1 is perfect. And this gives us a way to generate perfect numbers. For example, since 2 to the second minus 1 equals 3 is prime, then 2 to the 2 minus 1 times 2 to the second minus 1, that's 6, is perfect. We find that 2 to the third minus 1, that's 7 is prime, and so that gives us another perfect number. And with a little effort, we can find a few more perfect numbers. It appears that there's one perfect number in every order of magnitude. In other words, there's one one-digit perfect number, one two-digit perfect number, one three-digit perfect number, and one four-digit perfect number. And this suggests there might be a five-digit perfect number and so on. But in fact, the next perfect number has eight digits, and this was discovered during the Middle Ages. Now finding Euclidean perfect numbers, and in fact solving many other problems in number 3, relied on prime numbers. But the only way known to Fermat to determine if a number was prime was through trial division. And this is a tedious problem. And in fact, on December 26, 1638, Fermat wrote to Mersan, the length of these computations repels me. Still Fermat must have thought number theory to be important enough to be worth the extra time and effort, and by June 1640 he made a crucial observation which he communicated to Mersan. Fermat considered the 2 to the n minus 1 numbers, which he called the roots, since they were the roots of the perfect numbers. In other words, once you knew this number, you could create a perfect number. Now going forward, it's useful to remember that 2 is an odd prime. And it requires some special handling, and often it's best to ignore it. So the first of Fermat's observations is that if the exponent is composite, so is the root. So for example, the exponent n equals 6 is composite, and the corresponding root 2 to the 6 minus 1, 63, is composite. Next, if the exponent is prime, then twice the exponent divided the root minus 1. For example, n equals 7 is prime, and the corresponding root 127 minus 1, 126, is divisible by 2 times 7, 14. And probably the most important of these observations, if the exponent is prime, the prime divisors of the root are one more than the multiple of twice the exponent. So for example, n equals 11 gives the root 2 to the 11 minus 1, 2047, and it turns out this number is actually composite. It's 23 times 89, and we notice that 23 is twice the exponent plus 1, and 89 is 8 times the exponent plus 1. The importance of these observations is twofold. First, it tells us that we shouldn't even bother with exponents that are composite, because the root will be guaranteed composite. And second, if 2 to the n minus 1 is composite, the last of Fermat's observation gives us a list of what the prime factors might be. For example, in 1603, Pietrocateldi presented a list of perfect numbers, and one of the numbers on the list required 2 to the 37 minus 1 to be prime. It turns out that this number is not actually prime, but in fact it does have factors. So the potential prime factors of 2 to the 37 minus 1 are one more than multiples of twice the root, 74. So 1 times 74 plus 1, that's 75, but that's not a prime number, so it's not a potential factor. 2 times 74 plus 1, 149, that is a prime number. And so the first potential prime factor is 149, and we find... So since there's a remainder, 149 is not a factor. But 3 times 74 plus 1, that's 223, which is also prime. And so our next potential prime factor is 223, and we find... And since this number is divisible by 223, we know that 2 to the power 37 minus 1 is not prime. And here's the important thing, we only needed 2 trial divisions. And that means we have a way of avoiding these lengthy computations that Fermat didn't want to engage in. Since Euclidean perfect numbers relied on primes of the form 2 to the n minus 1, Fermat's work provided a way forward. First, n had to be prime. Second, it's possible that prime n could give composite numbers, but any potential factor of 2 to the n minus 1 must be 1 more than a multiple of 2n. And this allows us to quickly determine whether 2 to the n minus 1 is prime. For example, let's determine if 2 to the 17th minus 1 is prime. And so we'll check the potential factors of 2 to the 17th minus 1. Now, potential factors of 2 to the 17th minus 1 are 1 more than a multiple of 2 times 17, 34. And so you might go through our list. 1 times 34 plus 1 is 35, which isn't prime. 2 times 34 plus 1, that's 69, also not prime. 3 times 34 plus 1 is 103, which is prime. And so we should check to see if it's a factor. And so we'll divide by 103 to get. And since there's a remainder, this means that 103 is not a factor. 4 times 34 plus 1 is 137, which is prime. And again, we'll have to check to see if it's a factor. But it isn't. 5 times 34 plus 1 is 171, which is not prime. 6 times 34 plus 1, 205, not prime. 7 times 34 plus 1, 239, which is prime. But when we check it, it's not a factor. 8 times 34 plus 1 is not prime. 9 times 34 plus 1 is 307, but we find it's not a factor. 10 and 11 times 34 plus 1 are not primes. And since 335 squared is greater than our number, there are no more possible prime factors. And again, the significance here is that to determine whether this number is prime, we only had to do four trial divisions. And because none of them worked, we know there are no prime factors. And so our number is prime, which means we can also compute a perfect number.