Special numbers

Karina Walker
maths@dover
Published in
4 min readApr 19, 2019

A lot of people know and love the Simpsons. But did you know it was written by mathematicians?

This is a screengrab from one of the episodes. Do you recognise anything special about the numbers?

Let’s take a look. We’ll start by defining a few types of numbers.

A prime number is a number that can only be divided by 1 and itself. Most people will probably be able to list off the first few primes as 2, 3, 5, 7… If you try to keep finding the next prime, you will soon realise the bigger the number, the harder to tell if its prime or not.

Thus, it makes sense to ask: are there an infinite number of primes?

The set of prime numbers has actually been proven to be infinite. One of the many proofs is by Euclid, using a proof by contradiction.

Let the list of primes be finite from P1 to Pn. Considering a number that is a product of the all these primes plus 1. By construction it is not divisible by any of the primes. And so is either a prime itself or divisible by a prime not in the list of all prime numbers P1 to Pn. Which is a contradiction as we defined P1 to Pn to be the list of all prime numbers.

Prime numbers are rare in itself, but they are two types of primes which are increasingly rare. Mersenne primes and Fermat’s primes.

Mersenne prime
Fermat’s primes

The largest known prime number is a Mersenne prime. Are all Mersenne numbers prime though?

List of Mersenne primes

As shown above, not all are prime. From the first couple values of n, it seems that if n is prime, the number generated is prime. However, it’s actually the converse that’s true (n=11 breaks this pattern): if the number generated by that sequence is prime, n is also prime.

For the prime number hunters, this is unhelpful, as we have to generate a larger prime to find a smaller prime. As you can imagine, the generation of these numbers take an awful lot of computing power. You can contribute to the search on this website: https://www.mersenne.org/

Fermat prime numbers generated in the form above are in fact so rare, there are only 5 known Fermat primes. 3, 5, 17, 257, 65537. It is speculated there are no other Fermat primes, but this hasn’t been proven true.

Now that you know what primes are, if you haven’t done so already, take a look once again at the Simpsons image, do you notice anything special about the numbers?

Let’s look at another set of numbers very closely linked to Mersenne primes, called perfect numbers. A perfect number is a number that equals the sum of its proper factors. The smallest being 6 = 3 + 2 + 1. All even perfect numbers have a Mersenne prime as a factor and so whenever a new Mersenne prime is found, a new corresponding perfect number can be found! All perfect numbers have been found to be even so far, but no one has managed to prove a perfect number could not be odd.

Link between Mersenne primes and perfect numbers

The last type of number I want to take a look are narcissistic numbers. By definition, a narcissistic number is full of itself. A narcissistic number is the sum of its own digits each raised to the power of the number of digits. The first 9 are easy: 1, 2, 3, 4, 5, 6, 7, 8, 9. After that though, it becomes more interesting:

A narcissistic number

Let’s return to the Simpsons. If you still think these numbers from the Simpsons are random, try taking a guess at what each number is.

If you have done so, for reference:

8191 is a Mersenne prime.

8128 is a perfect number.

8208 is a narcissistic number.

If you want to know more about special numbers, comment below!

--

--