Thursday, May 12, 2016

Happy Numbers

Some numbers are weird; others are happy. If you’d like to find out if a given number is happy, you’ll need to perform the following set of operations. Let’s take the number 44:
First, square each digit, then add them together:
4^2 + 4^2 = 16 + 16 = 32
Then, we’ll do it again with our new number:
3^2 + 2^2 = 9 + 4 = 13
And again:
1^2 + 3^2 = 1 + 9 = 10
And finally:
1^2 + 0^2 = 1 + 0 = 1
Voila! It’s a happy number. Anytime you take a number, perform this “procedure,” and eventually arrive at the number 1, you have yourself a happy number. If your number never reaches 1, then sadly, it’s unhappy. Interestingly, happy number are extremely common; there are 11 of them between 1 and 50, for example.
As a final note, the greatest happy number with no recurring digits is 986,543,210. That is a happy number indeed.

No comments:

Post a Comment