First n “strange” numbers

A positive number n>0n > 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=13+53+33153 = 1^{3} + 5^{3} + 3^{3}.

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

Input

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

Output

Prints the list with the first nn “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