In recreational number theory, a narcissistic number (also known as a pluperfect digital invariant (PPDI), an Armstrong number (after Michael F. Armstrong) or a plus perfect number) is a number that is the sum of its own digits each raised to the power of the number of digits. This definition depends on the base b of the number system used, e.g., b = 10 for the decimal system or b = 2 for the binary system.
The definition of a narcissistic number relies on the decimal representation n = dkdk-1...d1 of a natural number n, i.e.,
with k digits di satisfying 0 ≤ di ≤ 9. Such a number n is called narcissistic if it satisfies the condition
For example the 3-digit decimal number 153 is a narcissistic number because 153 = 13 + 53 + 33.
Narcissistic numbers can also be defined with respect to numeral systems with a base b other than b = 10. The base-b representation of a natural number n is defined by
where the base-b digits di satisfy the condition 0 ≤ di ≤ b-1. For example the (decimal) number 17 is a narcissistic number with respect to the numeral system with base b = 3. Its three base-3 digits are 122, because 17 = 1·32 + 2·3 + 2 , and it satisfies the equation 17 = 13 + 23 + 23.
If the constraint that the power must equal the number of digits is dropped, so that for some m possibly different from k it happens that
then n is called a perfect digital invariant or PDI. For example, the decimal number 4150 has four decimal digits and is the sum of the fifth powers of its decimal digits
so it is a perfect digital invariant but not a narcissistic number.
In "A Mathematician's Apology", G. H. Hardy wrote:
The sequence of base 10 narcissistic numbers starts: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 153, 370, 371, 407, 1634, 8208, 9474, ... (sequence in the OEIS)