← 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

20⇒22+02=420 \Rightarrow 2^2 + 0^2 = 4
4⇒42=164 \Rightarrow 4^2 = 16
16⇒12+62=1+36=3716 \Rightarrow 1^2 + 6^2 = 1 + 36 = 37
37⇒32+72=9+49=5837 \Rightarrow 3^2 + 7^2 = 9 + 49 = 58
58⇒52+82=25+64=8958 \Rightarrow 5^2 + 8^2 = 25 + 64 = 89
89⇒82+92=64+81=14589 \Rightarrow 8^2 + 9^2 = 64 + 81 = 145
145⇒12+42+52=1+16+25=42145 \Rightarrow 1^2 + 4^2 + 5^2 = 1 + 16 + 25 = 42
42⇒42+22=16+4=2042 \Rightarrow 4^2 + 2^2 = 16 + 4 = 20 — we have reached a loop
20⇒…20 \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

2026⇒22+02+22+62=4+0+4+36=442026 \Rightarrow 2^2 + 0^2 + 2^2 + 6^2 = 4 + 0 + 4 + 36 = 44
44⇒42+42=16+16=3244 \Rightarrow 4^2 + 4^2 = 16 + 16 = 32
32⇒32+22=9+4=1332 \Rightarrow 3^2 + 2^2 = 9 + 4 = 13
13⇒12+32=1+9=1013 \Rightarrow 1^2 + 3^2 = 1 + 9 = 10
10⇒12+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