In 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) 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.
Definition 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:
F b ( n ) = ∑ i = 0 k − 1 d i k . {\displaystyle F_{b}(n)=\sum _{i=0}^{k-1}d_{i}^{k}.}
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
d i = n mod b i + 1 − n mod b i b i {\displaystyle d_{i}={\frac {n{\bmod {b^{i+1}}}-n{\bmod {b}}^{i}}{b^{i}}}}
… excerpt ends here. Continue reading the full article.
