6 kyu
Does my number look big in this?
74,014 of 183,812JulianNicholls
Description:
A Narcissistic Number (or Armstrong Number) is a positive number which is the sum of its own digits, each raised to the power of the number of digits in a given base. In this Kata, we will restrict ourselves to decimal (base 10).
For example, take 153 (3 digits), which is narcissistic:
1^3 + 5^3 + 3^3 = 1 + 125 + 27 = 153
and 1652 (4 digits), which isn't:
1^4 + 6^4 + 5^4 + 2^4 = 1 + 1296 + 625 + 16 = 1938
The Challenge:
Your code must return true or false (not 'true' and 'false') depending upon whether the given number is a Narcissistic number in base 10.
This may be True and False in your language, e.g. PHP.
Error checking for text strings or other invalid inputs is not required, only valid positive non-zero integers will be passed into the function.
Algorithms
Similar Kata:
Stats:
Created | Nov 16, 2013 |
Published | Nov 16, 2013 |
Warriors Trained | 343211 |
Total Skips | 33925 |
Total Code Submissions | 485457 |
Total Times Completed | 183812 |
Ruby Completions | 5674 |
JavaScript Completions | 59370 |
CoffeeScript Completions | 244 |
Haskell Completions | 1476 |
Python Completions | 74014 |
C# Completions | 11091 |
PHP Completions | 5196 |
C++ Completions | 11902 |
NASM Completions | 30 |
Nim Completions | 36 |
Scala Completions | 609 |
C Completions | 4051 |
TypeScript Completions | 4577 |
COBOL Completions | 19 |
Factor Completions | 10 |
Lua Completions | 217 |
R Completions | 171 |
Java Completions | 7151 |
Swift Completions | 256 |
Rust Completions | 893 |
Crystal Completions | 9 |
Julia Completions | 50 |
D Completions | 7 |
Groovy Completions | 6 |
Total Stars | 1842 |
% of votes with a positive feedback rating | 92% of 15341 |
Total "Very Satisfied" Votes | 12917 |
Total "Somewhat Satisfied" Votes | 2258 |
Total "Not Satisfied" Votes | 166 |