/narcissistic_number

Primary LanguagePythonMIT LicenseMIT

narcissistic_number

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 is a number that is the sum of its own digits each raised to the power of the number of digits. (Wikipedia)

In this python code the base (b) is 10 and it produces all the narcissistic numbers in an infinite loop.

You can see the sequence on A005188.

The sequence is as follows: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 153, 370, 371, 407, 1634, 8208, 9474, 54748, 92727, 93084, 548834, ...