First n “strange” numbers

A positive number n > 0 is “strange” if when adding each of its digits
raised to the number of digits that make it up, we obtain the number
itself.

For example, 153 (which has three digits) is “strange”,
153 = 1³ + 5³ + 3³.

Make a program that returns the first n “strange” numbers.

Input

A positive integer, n > 0, asking for the first n “strange” numbers.

Output

Prints the list with the first n “strange” numbers.

Observation

It is forbidden to use any external function except cin and cout, and
also the program must be well documented if not it will be invalidated.

Problem information

Author: PRO1

Generation: 2026-01-25T22:28:30.356Z

© Jutge.org, 2006–2026.
https://jutge.org
