Skip to main content

Happy Number

Happy number is a positive integer that gives the final number as 1 when certain steps (square and sum the digits) are performed continuously.

Checking a Happy Number

Step 1: Consider any number.

Step 2: Square the number and replace the resultant with the sum of the squares of its digits.

Step 3: Repeat the steps. The final number will be 1, or the steps will loop endlessly in a cycle.

Those numbers (considered in Step 1) that give the final number as 1 are Happy numbers.

Examples

Example 1

Step 1: Consider number 1.

Step 2: Square the number => 12 => 1 x 1 => 1.

Step 3: Repeat the steps.

12 => 1 x 1 => 1

Repeating the steps gives the final number as 1. Therefore, the number considered in Step 1 is a Happy number.

Example 2

Step 1: Consider number 2.

Step 2: Square the number => 22 => 2 x 2 => 4.

Step 3: Repeat the steps.

42 => 4 x 4 => 16

12 + 62 => 1 + 36 => 37

32 + 72 => 9 + 49 => 58

52 + 8 => 25 + 64 => 89

82 + 92 => 64 + 81 => 145

12 + 42 + 52 => 1 + 16 + 25 => 42

42 + 22 => 16 + 4 => 20

22 + 02 => 4 + 0 => 4

42 => 16

12 + 62 => 1 + 36 => 37

Repeating the steps does not give the final number as 1 and loop endlessly in a cycle. Therefore, the number considered in Step 1 is not a Happy number.

Example 3

Step 1: Consider number 3.

Step 2: Square the number => 32 => 3 x 3 => 9.

Step 3: Repeat the steps.

92 => 9 x 9 => 81

82 + 12 => 64 + 1 => 65

62 + 52 => 36 + 25 => 61

62 + 12 => 36 + 1 => 37

32 + 72 => 9 + 49 => 58

52 + 82 => 25 + 64 => 89

82 + 92 => 64 + 81 => 145

12 + 42 + 52 => 1 + 16 + 25 => 42

42 + 22 => 16 + 4 => 20

22 + 02 => 4 + 0 => 4

42 => 16

12 + 62 => 1 + 36 => 37

32 + 72 => 9 + 49 => 58

Repeating the steps does not give the final number as 1 and loop endlessly in a cycle. Therefore, the number considered in Step 1 is not a Happy number.

Example 4

Step 1: Consider number 4.

Step 2: Square the number => 42 => 4 x 4 => 16.

Step 3: Repeat the steps.

162 => 16 x 16 => 256

22 + 52 + 62 => 4 + 25 + 36 => 65

62 + 52 => 36 + 25 => 61

62 + 12 => 36 + 1 => 37

32 + 72 => 9 + 49 => 58

52 + 82 => 25 + 64 => 89

82 + 92 => 64 + 81 => 145

12 + 42 + 52 => 1 + 16 + 25 => 42

42 + 22 => 16 + 4 => 20

22 + 02 => 4 + 0 => 4

42 => 16

162 => 16 x 16 => 256

22 + 52 + 62 => 4 + 25 + 36 => 65

Repeating the steps does not give the final number as 1 and loop endlessly in a cycle. Therefore, the number considered in Step 1 is not a Happy number.

Example 5

Step 1: Consider number 5.

Step 2: Square the number => 52 => 5 x 5 => 25.

Step 3: Repeat the steps.

252 => 25 x 25 => 625

62 + 22 + 52 => 36 + 4 + 25 => 65

62 + 52 => 36 + 25 => 61

62 + 12 => 36 + 1 => 37

32 + 72 => 9 + 49 => 58

52 + 82 => 25 + 64 => 89

82 + 92 => 64 + 81 => 145

12 + 42 + 52 => 1 + 16 + 25 => 42

42 + 22 => 16 + 4 => 20

22 + 02 => 4 + 0 => 4

42 => 16

12 + 62 => 1 + 36 => 37

32 + 72 => 9 + 49 => 58

Repeating the steps does not give the final number as 1 and loop endlessly in a cycle. Therefore, the number considered in Step 1 is not a Happy number.

Example 6

Step 1: Consider number 6.

Step 2: Square the number => 62 => 6 x 6 => 36.

Step 3: Repeat the steps.

362 => 36 x 36 => 1296

12 + 22 + 92 + 62 => 1 + 4 + 81 + 36 => 122

12 + 22 + 22 => 1 + 4 + 4 => 9

92 => 81

82 + 12 => 64 + 1 => 65

62 + 52 => 36 + 25 => 61

62 + 12 => 36 + 1 => 37

32 + 72 => 9 + 49 => 58

52 + 82 => 25 + 64 => 89

82 + 92 => 64 + 81 => 145

12 + 42 + 52 => 1 + 16 + 25 => 42

42 + 22 => 16 + 4 => 20

22 + 02 => 4 + 0 => 4

42 => 16

12 + 62 => 1 + 36 => 37

32 + 72 => 9 + 49 => 58

Repeating the steps does not give the final number as 1 and loop endlessly in a cycle. Therefore, the number considered in Step 1 is not a Happy number.

Example 7

Step 1: Consider number 7.

Step 2: Square the number => 72 => 7 x 7 => 49.

Step 3: Repeat the steps.

42 + 92 => 16 + 81 => 97

92 + 72 => 81 + 49 => 130

12 + 32 + 02 => 1 + 9 + 0 => 10

12 + 02 => 1 + 0 => 1

Repeating the steps gives the final number as 1. Therefore, the number considered in Step 1 is a Happy number.

Hope you have understood this mazing concept of the Happy number. To check whether a number is a Happy number or not, use the above examples. In case of any query, please feel free to provide your valuable comments.

Comments

Popular posts from this blog

Dudeney Number

Dudeney number is a positive integer that is equal to the cube of the sum of all its digits. Checking a Dudeney Number Step 1 : Consider any number. Step 2 : Sum all its digits. Step 3 : Cube the number obtained in Step 2. If the number obtained in Step 3 is equal to the number considered in Step 1, it is a Dudeney number. But if the number obtained in Step 3 is not equal to the number considered in Step 1, it is not a Dudeney number. Examples Example 1 Step 1 : Consider number 0. Step 2 : Sum all its digits. The resultant is 0. Step 3 : Cube the number 0 obtained in Step 2 => 0 3 => 0 x 0 x 0. The resultant is 0. The number obtained in Step 3 is equal to the number considered in Step 1, hence 0 is a Dudeney number. Example 2 Step 1 : Consider number 1. Step 2 : Sum all its digits. The resultant is 1. Step 3 : Cube the number 1 obtained in Step 2 => 1 3 => 1 x 1 x 1. The resultant is 1. The number obtained in Step 3 is equal to the number considered in Step 1, hence 1 i...

Universe Secret Code 369 Theory

When it comes to the origin of the universe secret code 369 theory, one name associated with this amazing concept is ‘Nikola Tesla’. Nikola Tesla [10 July 1856 – 07 January 1943] was not only a great inventor / scientist, but also the greatest mind of all the time. He has done a plenty of research throughout his life, and highly recognized for his contributions towards the following : High Voltage, High Frequency Power Experiments Alternating Current (AC) Electricity Supply System Apart from the above-mentioned contributions, he has given ‘Universe Secret Code 369 Theory’ and has called the number 369 – the key to the universe. Now the question that will come to the curious minds is that why Nikola Tesla has called this number the key to the universe. The answer to this question is described in this post. Let start with a specific pattern as shown below: 1 1 + 1 => 2 2 + 2 => 4 4 + 4 => 8 8 + 8 => 16; 1 + 6 => 7 16 + 16 => 32; 3 + 2 => 5 >>>>>>...

The RATS Sequence

In Mathematics, one of the amazing concepts is the Reverse-Add-Then-Sort (RATS) Sequence. The RATS Sequence is a sequence that is formed by reversing , adding , then sorting the digits. Let's understand this concept in detail: Form the RATS Sequence Step 1 : Consider any number (must be greater than 0). Step 2 : Reverse the number. Step 3 : Add the original number (considered in Step 1) with the number formed by reversing the number (in Step 2). Step 4 : Sort the number obtained in Step 3 in ascending order. The resultant obtained after sorting the number forms the next sequence after n iteration. Examples First Iteration Step 1 : Number 1 . Step 2 : Reversing the number 1  gives the resultant  1 . Step 3 : Adding the original number 1 (considered in Step 1) with the number formed by reversing (in Step 2)  i.e. 1 gives the resultant 2 . Step 4 : Sorting the number obtained in Step 3 in ascending order gives the resultant 2 . Here number 2 forms the next sequence after...