27 lines
1.5 KiB
Text
27 lines
1.5 KiB
Text
A [http://mathworld.wolfram.com/NarcissisticNumber.html Narcissistic decimal number] is a non-negative integer, <math>n</math>, that is equal to the sum of the <math>m</math>-th powers of each of the digits in the decimal representation of <math>n</math>, where <math>m</math> is the number of digits in the decimal representation of <math>n</math>.
|
|
|
|
|
|
Narcissistic (decimal) numbers are sometimes called '''Armstrong''' numbers, named after Michael F. Armstrong.
|
|
<br>They are also known as '''Plus Perfect''' numbers.
|
|
|
|
|
|
;An example:
|
|
::::* if <math>n</math> is '''153'''
|
|
::::* then <math>m</math>, (the number of decimal digits) is '''3'''
|
|
::::* we have <big> 1<sup>3</sup> + 5<sup>3</sup> + 3<sup>3</sup> = 1 + 125 + 27 = '''153''' </big>
|
|
::::* and so '''153''' is a narcissistic decimal number
|
|
|
|
|
|
;Task:
|
|
Generate and show here the first '''25''' narcissistic decimal numbers.
|
|
|
|
|
|
|
|
Note: <math>0^1 = 0</math>, the first in the series.
|
|
|
|
|
|
;See also:
|
|
* the OEIS entry: [http://oeis.org/A005188 Armstrong (or Plus Perfect, or narcissistic) numbers].
|
|
* MathWorld entry: [http://mathworld.wolfram.com/NarcissisticNumber.html Narcissistic Number].
|
|
* Wikipedia entry: [https://en.wikipedia.org/wiki/Narcissistic_number Narcissistic number].
|
|
<br><br>
|