First n strange numbers X76141


Statement
 

pdf   zip

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.

Public test cases
  • Input

    15
    

    Output

    1 2 3 4 5 6 7 8 9 153 370 371 407 1634 8208 
  • Information
    Author
    PRO1
    Language
    English
    Translator
    Original language
    Catalan
    Other languages
    Catalan Spanish
    Official solutions
    C++
    User solutions
    C++