Tool to test if a number is an Armstrong number, explaining the calculation step by step and exploring narcissistic numbers in base 10.
Armstrong Number - dCode
Tag(s) : Arithmetics
dCode is free and its tools are a valuable help in games, maths, geocaching, puzzles and problems to solve every day!
A suggestion ? a feedback ? a bug ? an idea ? Write to dCode!
An Armstrong number (also called a narcissistic number or pluperfect number) is a non-negative natural number expressed in base 10 with $ n $ digits and equal to the sum of the nth powers of each of its digits.
In other words, if a number $ N $ can be written with the digits $ d_1, d_2, \dots, d_n $, then $ N = d_1^n + d_2^n + \dots + d_n^n $
Example: $ 153 $ is an Armstrong number because it has $ 3 $ digits and $ 1^3 + 5^3 + 3^3 = 1 + 125 + 27 = 153 $
To check if a number is an Armstrong number:
— Count the number of digits $ n $ in the number
— Extract each digit and calculate its nth power
— Calculate the sum of these powers
— Compare the sum to the original number
If the two values are equal, the number is an Armstrong number!
Example: 9474 has 4 digits, n=4, and $ 9^4 + 4^4 + 7^4 + 4^4 = 6561 + 256 + 2401 + 256 = 9474 $, therefore 9474 is an Armstrong number
The complete list of Armstrong numbers is finite and known; it contains 89 terms:
| Rank | Number of Digits | Armstrong Number |
|---|---|---|
| 1 | 1 | 0 |
| 2 | 1 | 1 |
| 3 | 1 | 2 |
| 4 | 1 | 3 |
| 5 | 1 | 4 |
| 6 | 1 | 5 |
| 7 | 1 | 6 |
| 8 | 1 | 7 |
| 9 | 1 | 8 |
| 10 | 1 | 9 |
| 11 | 3 | 153 |
| 12 | 3 | 370 |
| 13 | 3 | 371 |
| 14 | 3 | 407 |
| 15 | 4 | 1634 |
| 16 | 4 | 8208 |
| 17 | 4 | 9474 |
| 18 | 5 | 54748 |
| 19 | 5 | 92727 |
| 20 | 5 | 93084 |
| 21 | 6 | 548834 |
| 22 | 7 | 1741725 |
| 23 | 7 | 4210818 |
| 24 | 7 | 9800817 |
| 25 | 7 | 9926315 |
| 26 | 8 | 24678050 |
| 27 | 8 | 24678051 |
| 28 | 8 | 88593477 |
| 29 | 9 | 146511208 |
| 30 | 9 | 472335975 |
| 31 | 9 | 534494836 |
| 32 | 9 | 912985153 |
| 33 | 10 | 4679307774 |
| 34 | 11 | 32164049650 |
| 35 | 11 | 32164049651 |
| 36 | 11 | 40028394225 |
| 37 | 11 | 42678290603 |
| 38 | 11 | 44708635679 |
| 39 | 11 | 49388550606 |
| 40 | 11 | 82693916578 |
| 41 | 11 | 94204591914 |
| 42 | 14 | 28116440335967 |
| 43 | 16 | 4338281769391370 |
| 44 | 16 | 4338281769391371 |
| 45 | 17 | 21897142587612075 |
| 46 | 17 | 35641594208964132 |
| 47 | 17 | 35875699062250035 |
| 48 | 19 | 1517841543307505039 |
| 49 | 19 | 3289582984443187032 |
| 50 | 19 | 4498128791164624869 |
| 51 | 19 | 4929273885928088826 |
| 52 | 20 | 63105425988599693916 |
| 53 | 21 | 128468643043731391252 |
| 54 | 21 | 449177399146038697307 |
| 55 | 23 | 21887696841122916288858 |
| 56 | 23 | 27879694893054074471405 |
| 57 | 23 | 27907865009977052567814 |
| 58 | 23 | 28361281321319229463398 |
| 59 | 23 | 35452590104031691935943 |
| 60 | 24 | 174088005938065293023722 |
| 61 | 24 | 188451485447897896036875 |
| 62 | 24 | 239313664430041569350093 |
| 63 | 25 | 1550475334214501539088894 |
| 64 | 25 | 1553242162893771850669378 |
| 65 | 25 | 3706907995955475988644380 |
| 66 | 25 | 3706907995955475988644381 |
| 67 | 25 | 4422095118095899619457938 |
| 68 | 27 | 121204998563613372405438066 |
| 69 | 27 | 121270696006801314328439376 |
| 70 | 27 | 128851796696487777842012787 |
| 71 | 27 | 174650464499531377631639254 |
| 72 | 27 | 177265453171792792366489765 |
| 73 | 29 | 14607640612971980372614873089 |
| 74 | 29 | 19008174136254279995012734740 |
| 75 | 29 | 19008174136254279995012734741 |
| 76 | 29 | 23866716435523975980390369295 |
| 77 | 31 | 1145037275765491025924292050346 |
| 78 | 31 | 1927890457142960697580636236639 |
| 79 | 31 | 2309092682616190307509695338915 |
| 80 | 32 | 17333509997782249308725103962772 |
| 81 | 33 | 186709961001538790100634132976990 |
| 82 | 33 | 186709961001538790100634132976991 |
| 83 | 34 | 1122763285329372541592822900204593 |
| 84 | 35 | 12639369517103790328947807201478392 |
| 85 | 35 | 12679937780272278566303885594196922 |
| 86 | 37 | 1219167219625434121569735803609966019 |
| 87 | 38 | 12815792078366059955099770545296129367 |
| 88 | 39 | 115132219018763992565095597973971522400 |
| 89 | 39 | 115132219018763992565095597973971522401 |
The largest therefore has 39 digits.
The list is referenced on OEIS A005188 here
A rigorous mathematical proof can be provided using the theorem of comparative growth.
An n-digit number becomes very large very quickly as n increases.
The sum of the powers of its digits increases much more slowly.
Beyond a certain number of digits, the sum can no longer catch up with the number itself.
Here is an example of source code in Python:// Python
def is_armstrong(n):
m = len(str(n))
sum = sum(int(d)**m for d in str(n))
return sum == n
These numbers were named in reference to Michael F. Armstrong, a mathematician who popularized these numbers in the 1960s.
dCode retains ownership of the "Armstrong Number" source code. Any algorithm for the "Armstrong Number" algorithm, applet or snippet or script (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, breaker, translator), or any "Armstrong Number" functions (calculate, convert, solve, decrypt / encrypt, decipher / cipher, decode / encode, translate) written in any informatic language (Python, Java, PHP, C#, Javascript, Matlab, etc.) or any database download or API access for "Armstrong Number" or any other element are not public (except explicit open source licence). Same with the download for offline use on PC, mobile, tablet, iPhone or Android app.
Reminder: dCode is an educational and teaching resource, accessible online for free and for everyone.
The content of the page "Armstrong Number" and its results may be freely copied and reused, including for commercial purposes, provided that dCode.fr is cited as the source (Creative Commons CC-BY free distribution license).
Exporting the results is free and can be done simply by clicking on the export icons ⤓ (.csv or .txt format) or ⧉ (copy and paste).
To cite dCode.fr on another website, use the link:
In a scientific article or book, the recommended bibliographic citation is: Armstrong Number on dCode.fr [online website], retrieved on 2026-01-29,