Dr Who and The Happy Prime Numbers

I spend a good deal of my time working with prime numbers. For public key encryption, we create a finite field, and constrain our numbers…

From Dr Who here

Dr Who and The Happy Prime Numbers

I spend a good deal of my time working with prime numbers. For public key encryption, we create a finite field, and constrain our numbers between 0 and a prime number (minus one). In fact, I have a few numbers that I use for testing. These are 97, 997, 2¹⁹-1 and 2²⁵⁵-19.

With prime numbers, we also have the special property of:

(a * b) (mod p) = (a mod p) * (b mod p) (mod p)

(a + b) (mod p) = (a mod p) +(b mod p) (mod p)

and so we can work on our mathematical operations, but always constrain with a (mod p) operation.

But, what are happy prime numbers? Well, we start with a positive integer, and then replace this number with the sum of the square of its digits, and then keep going until we get to 1 — this defines a happy number. If it goes on forever, it is a sad (or unhappy) prime number.

For example, 7 is a happy prime number:

7–> 49 -> 4² + 9² = 97 -> 9² + 7² = 130 -> 1²+3²= 10 -> 1² … a happy number

The first 20 happy prime numbers are then:

7, 13, 19, 23, 31, 79, 97, 103, 109, 139, 167, 193, 239, 263, 293, 313, 331, 367, 379, 383

And, so in this episode of Dr Who, the crew are asked about the next number in the sequence of 313, 331, and 367 in order to used to gain access to the spacehip’s back-up engines. Luckily the Dr knows the answer … 379:

Conclusions

So now you know what makes a prime number happy! Here’s some more information on prime numbers:

https://asecuritysite.com/primes/