Narcissistic Number Checker
Check if a number is narcissistic (Armstrong number) and find all narcissistic numbers up to a given limit.
Find all narcissistic numbers up to
What is a Narcissistic Number?
A narcissistic number (Armstrong number) equals the sum of its digits each raised to the power of the digit count. Example: 153 = 1Β³ + 5Β³ + 3Β³ = 153.
About this tool
A narcissistic number (also called an Armstrong number) is a number that equals the sum of its own digits each raised to the power of the number of digits. For example, 153 is narcissistic because 1Β³ + 5Β³ + 3Β³ = 153. These numbers are mathematically intriguing curiosities that appear rarely in the number system, making them fun to explore and understand.
To use this checker, simply enter any positive integer and the tool will instantly determine whether it is narcissistic. The calculation is performed entirely in your browser, so there's no need to create an account or worry about your privacy. It works with small numbers like 9 and large numbers alike, helping you verify mathematical properties quickly.
Narcissistic numbers are appreciated by math enthusiasts, students learning about number theory, and programmers exploring computational mathematics. The complete list of narcissistic numbers is finite and well-documented, making this tool useful for verification and educational exploration of mathematical patterns.
Frequently Asked Questions
Code Implementation
def is_narcissistic(n: int) -> bool:
"""Check if n is a narcissistic (Armstrong) number."""
digits = str(n)
power = len(digits)
return sum(int(d) ** power for d in digits) == n
def find_narcissistic(limit: int) -> list[int]:
"""Find all narcissistic numbers up to limit."""
return [n for n in range(limit + 1) if is_narcissistic(n)]
# Check specific numbers
for n in [153, 370, 371, 407, 1634, 9474]:
digits = [int(d) for d in str(n)]
power = len(str(n))
breakdown = " + ".join(f"{d}^{power}" for d in digits)
result = sum(d ** power for d in digits)
print(f"{n}: {breakdown} = {result} {'β' if result == n else 'β'}")
# Find all up to 10000
print("\nAll narcissistic numbers up to 10000:")
print(find_narcissistic(10000))Comments & Feedback
Comments are powered by Giscus. Sign in with GitHub to leave a comment.