filmov
tv
Happy Number Program in Python | What is Happy Number | Python Course for Beginners

Показать описание
In this video, I have discussed Python Program to Verify Given Number is Happy Number or not
#happynumber #python #parnikatutorials
A number is said to be happy if it yields 1 when replaced by the sum of squares of its digits repeatedly.
Let's understand by an example:
Number = 32
32+ 22 = 13
12 + 32 = 10
12 + 02 = 1
In this example, we split 32 to get the sum of squares of its digits which forms another number (13), we replace 32 by 13 to continue this cycle until result 1. We found 32 a happy number.
If the above cycle for any number results in 1 then that number will be a Happy number otherwise that will be an unhappy number resulting 4, 16, 37, 58, 89, 145, 42, 20,.....
Some Happy numbers are 7, 28, 100, 320, etc.
Social media Links:
To get the regular updates:
Playlists:
Virtual Coffee with Jagadeesh:
Digital Logic Design:
Computer Organization and Architecture:
C Programming:
Data Structures:
Theory of Computation:
Compiler Design:
Computer Networks:
For GATE PYQs and much more explore:
#happynumber #python #parnikatutorials
A number is said to be happy if it yields 1 when replaced by the sum of squares of its digits repeatedly.
Let's understand by an example:
Number = 32
32+ 22 = 13
12 + 32 = 10
12 + 02 = 1
In this example, we split 32 to get the sum of squares of its digits which forms another number (13), we replace 32 by 13 to continue this cycle until result 1. We found 32 a happy number.
If the above cycle for any number results in 1 then that number will be a Happy number otherwise that will be an unhappy number resulting 4, 16, 37, 58, 89, 145, 42, 20,.....
Some Happy numbers are 7, 28, 100, 320, etc.
Social media Links:
To get the regular updates:
Playlists:
Virtual Coffee with Jagadeesh:
Digital Logic Design:
Computer Organization and Architecture:
C Programming:
Data Structures:
Theory of Computation:
Compiler Design:
Computer Networks:
For GATE PYQs and much more explore: