Narcissistic number is a number that returns the original number when each digit is raised separately to the power of the number of digits. Checking a Narcissistic Number Step 1 : Consider any number. Step 2 : (Number) power of the number of digits If the number obtained in Step 2 is same as the number considered in Step 1, it is a Narcissistic number. But if the number obtained in Step 2 is different than the number considered in Step 1, it is not a Narcissistic number . Examples Example 1 Step 1 : Consider number 0. Step 2 : 0 1 => 0. The number obtained in Step 2 is same as the number considered in Step 1. Therefore, 0 is a Narcissistic number . Example 2 Step 1 : Consider number 1. Step 2 : 1 1 => 1. The number obtained in Step 2 is same as the number considered in Step 1. Therefore, 1 is a Narcissistic number . Example 3 Step 1 : Consider number 2. Step 2 : 2 1 => 2. The number obtained in Step 2 is same as the number considered in Step 1. Therefore, 2 is a Narcissistic...
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 => 1 2 => 1 x 1 => 1. Step 3 : Repeat the steps. 1 2 => 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 => 2 2 => 2 x 2 => 4. Step 3 : Repeat the steps. 4 2 => 4 x 4 => 16 1 2 + 6 2 => 1 + 36 => 37 3 2 + 7 2 => 9 + 49 => 58 5 2 + 8 => 2...