We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.

- All Contests
- ProjectEuler+
- Project Euler #119: Digit power sum

# Project Euler #119: Digit power sum

# Project Euler #119: Digit power sum

_{This problem is a programming version of Problem 119 from projecteuler.net}

We shall call a positive integer "interesting" if it contains at least two digits when written in base and is equal to the sum of its digits raised to some power.

For example, if , numbers and are "interesting".

For a given base , find all "interesting" numbers below .

**Input Format**

The input contains one integer .

**Constraints**

**Output Format**

Print one line containing all the "interesting" numbers for base in ascending order. The numbers should be printed in decimal numeral system.

**Sample Input**

```
10
```

**Sample Output**

```
81 512 2401 4913 5832 17576 19683 234256 390625 614656 1679616 17210368 34012224 52521875 60466176 205962976 612220032 8303765625 10460353203 24794911296 ...
```

**Explanation**

Only the first twenty numbers are shown in the "Sample output", the actual output contains numbers.