+ 5

[CHALLENGE!] Determine a Narcissistic Number

A Narcissistic Number is a number which is the sum of its own digits, each raised to the power of the number of digits. For example, take 153 (3 digits): 1^3 + 5^3 + 3^3 = 1 + 125 + 27 = 153 and 1634 (4 digits): 1^4 + 6^4 + 3^4 + 4^4 = 1 + 1296 + 81 + 256 = 1634 The Challenge: Your code must print true or false depending upon whether the given number is a Narcissistic number. Error checking for text strings or other invalid inputs is not required, only valid integers will be passed into the function.

21st Dec 2017, 5:32 AM
PERSONA
PERSONA - avatar
16 Answers
+ 18
from where u all find different names to a same challenge some call it armstong number , some call it crazy number & now narcissistic number ☺
22nd Dec 2017, 8:50 AM
Gaurav Agrawal
Gaurav Agrawal - avatar
21st Dec 2017, 1:59 PM
Justine Ogaraku
Justine Ogaraku - avatar
+ 11
Challenge accepted!!
21st Dec 2017, 1:34 PM
Justine Ogaraku
Justine Ogaraku - avatar
21st Dec 2017, 6:11 AM
GAWEN STEASY
GAWEN STEASY - avatar
22nd Dec 2017, 8:05 PM
Ferhat Sevim
Ferhat Sevim - avatar
22nd Dec 2017, 9:58 AM
noobcøder
noobcøder - avatar
+ 4
https://www.sololearn.com/Discuss/909843/?ref=app ?
21st Dec 2017, 7:21 AM
abdulazizumarovich
abdulazizumarovich - avatar
21st Dec 2017, 8:24 AM
Sebastián Zapata
Sebastián Zapata - avatar
+ 3
My try using Java. Works for both non-negative and negative numbers. https://code.sololearn.com/cs1B52k1eklj/?ref=app
21st Dec 2017, 10:18 AM
DAB
DAB - avatar
+ 3
Ruby: gives all narcissistic numbers between 0 and 100000 https://code.sololearn.com/cL47tkm4cuAK
21st Dec 2017, 7:14 PM
bedawang
bedawang - avatar
21st Dec 2017, 6:54 AM
PERSONA
PERSONA - avatar
23rd Dec 2017, 8:35 AM
Hiroki Masuda
Hiroki Masuda - avatar
+ 2
https://code.sololearn.com/cLSqXiLUP4Q5/?ref=app
29th Apr 2018, 12:25 PM
...
+ 1
oneliner + list of nar6 numbers smaller than 400.000 https://code.sololearn.com/cIZ6a9JtpV6f/?ref=app
21st Dec 2017, 4:12 PM
VcC
VcC - avatar
0
https://code.sololearn.com/cMfkiW4Yfi9x/?ref=app
30th Apr 2018, 3:03 PM
D Janapriya
D Janapriya - avatar