Happy Number Challenge | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 13

Happy Number Challenge

Happy number example :-13 13= 1^2 +3^2 =10 10=1^2 + 0^2=1 another example :-28 28=2^2+8^2=68 68=6^2+8^2=100 1^2+0^2+0^2=1 a number greater than 9 when split in in its one digit number and on sum of whose square gives 1 is happy number

12th Jan 2018, 9:54 AM
Peace Walker
Peace Walker - avatar
15 Answers
12th Jan 2018, 4:27 PM
Gaurav Agrawal
Gaurav Agrawal - avatar
+ 20
My old code, I think it is usable in response to this challenge: https://code.sololearn.com/WfUfsKoM0JD6/?ref=app
12th Jan 2018, 8:26 PM
LukArToDo
LukArToDo - avatar
+ 14
Shows how important Recursion is.... https://code.sololearn.com/cJEfu7z8Z0sv/?ref=app
12th Jan 2018, 4:42 PM
Justine Ogaraku
Justine Ogaraku - avatar
12th Jan 2018, 10:38 PM
Danijel Ivanović
Danijel Ivanović - avatar
+ 12
Working on it. 👷
12th Jan 2018, 4:21 PM
Justine Ogaraku
Justine Ogaraku - avatar
+ 12
13th Jan 2018, 11:57 AM
Danijel Ivanović
Danijel Ivanović - avatar
+ 10
https://code.sololearn.com/ceK30ROVyq69/?ref=app Thanks for nice challenge!
12th Jan 2018, 11:59 AM
abdulazizumarovich
abdulazizumarovich - avatar
+ 8
Recursion is well suited for this https://code.sololearn.com/cl18zUStheH7/?ref=app
12th Jan 2018, 2:34 PM
Louis
Louis - avatar
+ 7
https://code.sololearn.com/caSkJW3KLcHH/?ref=app My try. Works even for 7.
13th Jan 2018, 2:33 PM
Kinshuk Vasisht
Kinshuk Vasisht - avatar
13th Jan 2018, 7:19 AM
Mahdi Cheikhrouhou
Mahdi Cheikhrouhou - avatar
+ 4
https://code.sololearn.com/c0d8iE476M0h/?ref=app
14th Jan 2018, 11:05 AM
...
14th Jan 2018, 5:19 PM
István Ócsai
István Ócsai - avatar
+ 1
Here's my try: https://code.sololearn.com/c1igdby6129F/#py Very nice challenge, thanks!
15th Jan 2018, 4:08 AM
Giovanni M. Guidini
Giovanni M. Guidini - avatar
+ 1
https://code.sololearn.com/cebmaCTy39m7/#py Tried to make it work for higher pow level including square, and work for all base between 2 to 16 including traditional 10 base
16th Jan 2018, 11:30 PM
Lindsay Linjie Chen
Lindsay Linjie Chen - avatar
29th Oct 2019, 8:53 AM
Abhinav Koora