This code kata takes the typical kata to produce a list of primes or check if a number is a prime and puts a bit of a Doctor Who spin on it by producing a list of primes then checking to see if they are happy. A prime number is one that can only be factored by itself or one. A happy number is one that when the sum of the square of it’s digits are added then this method repeated will ultimately produce one.
For example 19 is a happy number:
12 + 92 = 82
82 + 22 = 68
62 + 82 = 100
12 + 02 + 02 = 1
A happy prime is a number that is happy and prime. This kata is designed to iterate through a list of numbers to determine if a number is both prime and happy and therefore a happy prime. It could be adjusted to allow for user input to determine if the number given is a happy prime.