Square-Cube Digit Usage code-golf math
It is a widely-cited fact that 69 is the only number that uses up all of the decimal digits of 0 to 9.
69² = 4761 69³ = 328509 A possible input to find this number is 0123456789, because it at least has one occurence of every number in this number range.
The point of this challenge is not to calculate both results (obviously). You need to find the smallest positive integer that uses up at least all of the digits supplied in the input after it is squared and cubed.
So, when provided an input such as 1:
1² = 1 1³ = 1 It means that 1 is the result of such an input.
Specification
The input doesn't have to be unique. For example, the input can be 1466 and here's the possible result:
4² = 16 4³ = 64 That means we can't just fullfill this input by just doing a number that only uses 1 digit of 6, it has to have 2 digits of 6 in the output.
Test casesSquare-Cube Digit Usage
Here's an exhausive list of all numbers from 1 to 10000.
1333 (or 3133/3313/3331) -> 111