← Blog

Birthday Special: Happy Numbers

A birthday-themed look at happy and sad numbers.

It's my 20th birthday today.
To celebrate, here's a special blog post about a fun concept in number theory: happy numbers.

In number theory, a happy number is a number which eventually reaches 1 when the number is replaced by the sum of the squares of each digit.
Wikipedia

Let's take a look at two numbers in particular.

20 (the age I am now) is a sad number :(.

Proof

2022+02=420 \Rightarrow 2^2 + 0^2 = 4
442=164 \Rightarrow 4^2 = 16
1612+62=1+36=3716 \Rightarrow 1^2 + 6^2 = 1 + 36 = 37
3732+72=9+49=5837 \Rightarrow 3^2 + 7^2 = 9 + 49 = 58
5852+82=25+64=8958 \Rightarrow 5^2 + 8^2 = 25 + 64 = 89
8982+92=64+81=14589 \Rightarrow 8^2 + 9^2 = 64 + 81 = 145
14512+42+52=1+16+25=42145 \Rightarrow 1^2 + 4^2 + 5^2 = 1 + 16 + 25 = 42
4242+22=16+4=2042 \Rightarrow 4^2 + 2^2 = 16 + 4 = 20 — we have reached a loop
2020 \Rightarrow \dots and it begins again

Thus, the squared sum of the digits of 20 reaches an infinite loop and never terminates by reaching 1, implying that 20 is a sad number. This concludes the proof.

But there is hope for me.

2026 is a happy number :).

Proof

202622+02+22+62=4+0+4+36=442026 \Rightarrow 2^2 + 0^2 + 2^2 + 6^2 = 4 + 0 + 4 + 36 = 44
4442+42=16+16=3244 \Rightarrow 4^2 + 4^2 = 16 + 16 = 32
3232+22=9+4=1332 \Rightarrow 3^2 + 2^2 = 9 + 4 = 13
1312+32=1+9=1013 \Rightarrow 1^2 + 3^2 = 1 + 9 = 10
1012+02=110 \Rightarrow 1^2 + 0^2 = 1 — we have reached 1

Thus, the squared sum of the digits of 2026 eventually reaches 1, implying that 2026 is a happy number. This concludes the proof.

That's all. Happy birthday to my February 16th twins!

Comments