Continuing my previous post, we will now look at happy and
palindromic numbers...

For example, 19 is a happy number because 1

20, however, is not a happy number as 2

The first 10 happy numbers are 1, 7, 10, 13, 19, 23, 28, 31, 32 and 44. Happy numbers which are also prime are, inventively, called Happy Primes; examples of which are 7 and 19.

**For any number, if you add up the squares of each digit and repeat this you will eventually either reach 1 or start an endlessly repeating loop. Numbers which result in a value of 1 are called Happy Numbers.**__Happy Numbers__

For example, 19 is a happy number because 1

^{2}+ 9^{2}= 82, 8^{2}+ 2^{2}= 68, 6^{2}+ 8^{2}= 100, 1^{2}+ 0^{2}+ 0^{2}= 1. As you can see, this ends in 1 and 19 is therefore a happy number.20, however, is not a happy number as 2

^{2 }+ 0^{2}= 4, 4^{2 }= 16, 1^{2 }+ 6^{2}=37, 3^{2}+7^{2}=58, 5^{2 }+8^{2}=89, 8^{2}+9^{2}=145, 1^{2}+4^{2}+5^{2}=42, 4^{2}+2^{2}=20 which is back where we began. In fact, every non-happy number ends up in this sequence; 20, 4, 16, 37, 58, 89, 145, 42, 20.The first 10 happy numbers are 1, 7, 10, 13, 19, 23, 28, 31, 32 and 44. Happy numbers which are also prime are, inventively, called Happy Primes; examples of which are 7 and 19.

**Palindromic numbers, in the same way as palindromic words or phrases, are numbers which are the same when reversed, e.g. 131.**

__Palindromic Numbers__

In themselves they may not be that interesting, there are infinitely many and quite regular, but they can be combined with other sets of numbers to give interesting results. For example Palindromic Primes (palprimes) include 313, 797 and Belphegor's Prime: 1000000000000066600000000000001.

By their nature, all Mersenne and Fermat primes are palindromic when written in binary as they are either a run of '1's or a run of '0's with '1's at both ends. For example 31, 11111, is a Mersenne prime and 17, 10001, is a Fermat prime.

Combining these gives Palindromic Happy Prime Nunbers, the first one being 10

^{150006}+ 7426247×10

^{75000}+ 1 which has over 150 thousand digits.

This is so awesome! I have never heard of happy numbers. I showed my students this in class and we had so much fun exploring and finding happy numbers. They all wanted to know if their favorite numbers were happy or not haha. Thanks!

ReplyDeleteReally pleased to hear this! Thanks for telling me :)

ReplyDelete