In number theory, a narcissistic number[1][2] (also known as a pluperfect digital invariant (PPDI),[3] an Armstrong number[4] (after Michael F. Armstrong)[5] or a plus perfect number)[6] in a given number base b {\displaystyle b} is a number that is the sum of its own digits each raised to the power of the number of digits.
Let n {\displaystyle n} be a natural number. We define the narcissistic function for base b > 1 {\displaystyle b>1} F b : N → N {\displaystyle F_{b}:\mathbb {N} \rightarrow \mathbb {N} } to be the following:
where k = ⌊ log b n ⌋ + 1 {\displaystyle k=\lfloor \log _{b}{n}\rfloor +1} is the number of digits in the number in base b {\displaystyle b} , and
is the value of each digit of the number. A natural number n {\displaystyle n} is a narcissistic number if it is a fixed point for F b {\displaystyle F_{b}} , which occurs if F b ( n ) = n {\displaystyle F_{b}(n)=n} . The natural numbers 0 ≤ n < b {\displaystyle 0\leq n<b} are trivial narcissistic numbers for all b {\displaystyle b} , all other narcissistic numbers are nontrivial narcissistic numbers.
For example, the number 153 in base b = 10 {\displaystyle b=10} is a narcissistic number, because k = 3 {\displaystyle k=3} and 153 = 1 3 + 5 3 + 3 3 {\displaystyle 153=1^{3}+5^{3}+3^{3}} .
A natural number n {\displaystyle n} is a sociable narcissistic number if it is a periodic point for F b {\displaystyle F_{b}} , where F b p ( n ) = n {\displaystyle F_{b}^{p}(n)=n} for a positive integer p {\displaystyle p} (here F b p {\displaystyle F_{b}^{p}} is the p {\displaystyle p} th iterate of F b {\displaystyle F_{b}} ), and forms a cycle of period p {\displaystyle p} . A narcissistic number is a sociable narcissistic number with p = 1 {\displaystyle p=1} , and an amicable narcissistic number is a sociable narcissistic number with p = 2 {\displaystyle p=2} .
All natural numbers n {\displaystyle n} are preperiodic points for F b {\displaystyle F_{b}} , regardless of the base. This is because for any given digit count k {\displaystyle k} , the minimum possible value of n {\displaystyle n} is b k − 1 {\displaystyle b^{k-1}} , the maximum possible value of n {\displaystyle n} is b k − 1 ≤ b k {\displaystyle b^{k}-1\leq b^{k}} , and the narcissistic function value is F b ( n ) = k ( b − 1 ) k {\displaystyle F_{b}(n)=k(b-1)^{k}} . Thus, any narcissistic number must satisfy the inequality b k − 1 ≤ k ( b − 1 ) k ≤ b k {\displaystyle b^{k-1}\leq k(b-1)^{k}\leq b^{k}} . Multiplying all sides by b ( b − 1 ) k {\displaystyle {\frac {b}{(b-1)^{k}}}} , we get ( b b − 1 ) k ≤ b k ≤ b ( b b − 1 ) k {\displaystyle {\left({\frac {b}{b-1}}\right)}^{k}\leq bk\leq b{\left({\frac {b}{b-1}}\right)}^{k}} , or equivalently, k ≤ ( b b − 1 ) k ≤ b k {\displaystyle k\leq {\left({\frac {b}{b-1}}\right)}^{k}\leq bk} . Since b b − 1 ≥ 1 {\displaystyle {\frac {b}{b-1}}\geq 1} , this means that there will be a maximum value k {\displaystyle k} where ( b b − 1 ) k ≤ b k {\displaystyle {\left({\frac {b}{b-1}}\right)}^{k}\leq bk} , because of the exponential nature of ( b b − 1 ) k {\displaystyle {\left({\frac {b}{b-1}}\right)}^{k}} and the linearity of b k {\displaystyle bk} . Beyond this value k {\displaystyle k} , F b ( n ) ≤ n {\displaystyle F_{b}(n)\leq n} always. Thus, there are a finite number of narcissistic numbers, and any natural number is guaranteed to reach a periodic point or a fixed point less than b k − 1 {\displaystyle b^{k}-1} , making it a preperiodic point. Setting b {\displaystyle b} equal to 10 shows that the largest narcissistic number in base 10 must be less than 10 60 {\displaystyle 10^{60}} .[1]
The number of iterations i {\displaystyle i} needed for F b i ( n ) {\displaystyle F_{b}^{i}(n)} to reach a fixed point is the narcissistic function's persistence of n {\displaystyle n} , and undefined if it never reaches a fixed point.
A base b {\displaystyle b} has at least one two-digit narcissistic number if and only if b 2 + 1 {\displaystyle b^{2}+1} is not prime, and the number of two-digit narcissistic numbers in base b {\displaystyle b} equals τ ( b 2 + 1 ) − 2 {\displaystyle \tau (b^{2}+1)-2} , where τ ( n ) {\displaystyle \tau (n)} is the number of positive divisors of n {\displaystyle n} .
Every base b ≥ 3 {\displaystyle b\geq 3} that is not a multiple of nine has at least one three-digit narcissistic number. The bases that do not are
There are only 88 narcissistic numbers in base 10, of which the largest is
with 39 digits.[1]
All numbers are represented in base b {\displaystyle b} . '#' is the length of each known finite sequence.
1234 → 2404 → 4103 → 2323 → 1234
3424 → 4414 → 11034 → 20034 → 20144 → 31311 → 3424
1044302 → 2110314 → 1044302
1043300 → 1131014 → 1043300
44 → 52 → 45 → 105 → 330 → 130 → 44
13345 → 33244 → 15514 → 53404 → 41024 → 13345
14523 → 32253 → 25003 → 23424 → 14523
2245352 → 3431045 → 2245352
12444435 → 22045351 → 30145020 → 13531231 → 12444435
115531430 → 230104215 → 115531430
225435342 → 235501040 → 225435342
Narcissistic numbers can be extended to the negative integers by use of a signed-digit representation to represent each integer.