# Mathematical Fun With Happy Numbers

When I was in high school, a friend of mine--who happened to also be a foe from a rival math team--introduced me to the concept of a*Happy Number*.

"A

*Happy Number*," she said, "is a number that, if you square its digits, and add them together, and then take the result and square

*its*digits and add them together, and keep doing that over and over again, you come down to the number 1."

Clear? Well, I didn't get what she was saying until she gave me an example. So, let's try the number 32.

**32**: 3

^{2}+ 2

^{2}= 9 + 4 =

**13**

**13**: 1

^{2}+ 3

^{2}= 1 + 9 =

**10**

**10**: 1

^{2}+ 0

^{2}= 1 + 0 =

**1**

Ah-ha! It comes down to the number 1, so that means 32 is a Happy Number! (It also means that 13 and 10 are Happy Numbers as well, right?)

Well, that raised a question in my mind:

*How many times do you have to go through that cycle? What if it never comes down to 1? How will you know?*

Her answer was simple: If it never comes down to 1, it will come down to 4 instead. (Presumably, that's an UN-happy number!)

So here's an example of an

*Unhappy Number:*

**25**: 2

^{2}+ 5

^{2}= 4 + 25 =

**29**

**29**: 2

^{2}+ 9

^{2}= 4 + 81 =

**85**

**85**: 8

^{2}+ 5

^{2}= 64 + 25 =

**89**

**89**: 8

^{2}+ 9

^{2}= 64 + 81 =

**145**

**145**: 1

^{2}+ 4

^{2}+ 5

^{2}= 1 + 16 + 25 =

**42**

**42**: 4

^{2}+ 2

^{2}= 16 + 4 =

**20**

**20**: 2

^{2}+ 0

^{2}= 4 + 0 =

**4**

She was right! It came down to 4!

Do Happy Numbers have any practical application in the real world? Probably not. But there are some interesting questions and activities that are related to these numbers. Some are for advanced students, some are not. Here are some things you might want to have your students try. The first list is great for students who are struggling with addition facts and multiplication facts. The second list is for more advanced students.

**Math Fact Drilling**

- Is your telephone number a happy number?
- Is your street address a happy number?
- What about your weight, age, height? Are they happy?
- Find all the happy numbers between 1 and 20
- When you're going for a ride in the car, check out the license plate numbers. Can you figure out any of them
*in your head?*(This is a challenge, but makes a great travel game.)

**Theoretical Problems**

- Are there an infinite number of happy numbers?
- Are there an infinite number of unhappy numbers?
- Ellen told me that every number comes down to either one or four--can you prove it? (Hint: I wrote a computer program to help me with this one.)
- Can you find any patterns in the sequence of happy umbers?
- Does the ratio of happy to unhappy numbers approach a limit?

Finally, I will leave you with a unique number, which is called a

*Happy Cube*. The number is 153. Watch what happens when you do the happy number process, only

*cubing*instead of squaring.

**153**: 1

^{3}+ 5

^{3}+ 3

^{3}= 1 + 125 + 27 =

**153**

As far as I know, 1 and 153 are the only numbers that behave this way--when you sum the cubes of the digits, you get the number you started with. Can you find any others?

# Member Comments

Hi there, I just got done reading your "HAPPY NUMBERS" article, and just wanted to say, you DON'T have all the happy cubes.

Of course, zero works, but that's trivial.

There are also 370, 371 and 407!

Is that all of them?

Of course, zero works, but that's trivial.

There are also 370, 371 and 407!

Is that all of them?

Thanks for pointing that out. I must not have actually looked for other happy cubes, because I would have done it by writing a computer program, and I wouldn't have missed any.

Is there egg on my face?

If no one checks this out in the next couple weeks I'll crank out a proof.

*waits with bated breath for someone else to provide a proof*

Is there egg on my face?

**Quote**

There are also 370, 371 and 407!

Is that all of them?

Is that all of them?

If no one checks this out in the next couple weeks I'll crank out a proof.

*waits with bated breath for someone else to provide a proof*

Can you give me a suggestion on how to get started with this? If I had an idea how to begin, maybe I could figure it out myself.

Well, I would find a value X such that for all Y>X, F(Y)<X, where F(Y) is the value you get by summing the cubes of the digits of Y.

Once you've done that, you just need to write a computer program to find all happy cubes less than X, and you're done!

Once you've done that, you just need to write a computer program to find all happy cubes less than X, and you're done!

Thanks!

I wrote something a while ago that told me that there are only 5 'Happy Cubes'.

These are 1, 153, 370, 371, and 407. It also told me I didn't need to look any higher than 2916 to determine that there weren't any more (but I can't remember why that was).

These are 1, 153, 370, 371, and 407. It also told me I didn't need to look any higher than 2916 to determine that there weren't any more (but I can't remember why that was).

There are also several 'Happy (whatever you call something to the power of 4)'.

ie. when you sum the fourth power of the digits, you get the number you started with.

I reckon that 1 (of course), 1634, 8208, and 9474 are the only ones (I stopped looking beyond 33000).

ie. when you sum the fourth power of the digits, you get the number you started with.

I reckon that 1 (of course), 1634, 8208, and 9474 are the only ones (I stopped looking beyond 33000).

There are also several 'Happy (whatever you call something to the power of 5)'.

ie. when you sum the fifth power of the digits, you get the number you started with.

I reckon that 1 (of course), 4150, 4151, 54748, 92727, 93084 and 194979 are the only ones (I stopped looking beyond 355,000).

ie. when you sum the fifth power of the digits, you get the number you started with.

I reckon that 1 (of course), 4150, 4151, 54748, 92727, 93084 and 194979 are the only ones (I stopped looking beyond 355,000).

There are also several 'Happy (whatever you call something to the power of 6)'.

ie. when you sum the sixth power of the digits, you get the number you started with.

I reckon that 1 (of course) and 548834 are the only ones (I stopped looking beyond 3,721,000).

ie. when you sum the sixth power of the digits, you get the number you started with.

I reckon that 1 (of course) and 548834 are the only ones (I stopped looking beyond 3,721,000).

I can't find any 'Happy (whatever you call something to the power of 7)'.

ie. when you sum the seventh power of the digits, you get the number you started with.

I've looked up to 4,000,000, and reckon I've got to check up to 38,263,752 to prove whether there are any or not.

ie. when you sum the seventh power of the digits, you get the number you started with.

I've looked up to 4,000,000, and reckon I've got to check up to 38,263,752 to prove whether there are any or not.

I just found a Happy Seventh Power thing.

4,210,818 seems to work.

ie. when you sum the seventh power of the digits, you get the number you started with.

Are there any others ?

4,210,818 seems to work.

ie. when you sum the seventh power of the digits, you get the number you started with.

Are there any others ?

1,1741725,9800817,9926315,14459929

wow! You guys have been

Thanks again.

*busy*! Thanks for those posts. Martyn, there was a problem with the forum the day you posted those, and several of your posts got lost...but they're all back now.Thanks again.

To the best of my knowledge there is not a simple pattern, which is why I wrote a computer program to do it for me!

# Submit a comment

Please keep comments courteous and on-topic. All comments are moderated by the article author.

# Common Destinations

Click an icon below for some of the commonly accessed pages at*Articles for Educators*

Click here to read questions submitted by other teachers, and help them out from your own experiences.