Q: Gauss said: "The cube and the fourth power of my age contain each digit from 0 to 9 exactly once." The professor said: "It's a good coincidence because the square and the cube of my age contain each digit from 0 to 9 exactly once." Find their ages.
A: 18 and 69
Looking at the last digit can give us many clues in Math solutions and BC (before calculators) was how Math was often done!
In this case, we do not want to repeat a digit in both the cube and the fourth power because all the digits have to be different.
Here is a list of perfect cubes and perfect fourths from 1 to 10
Check out how the last digits are the same for 0 1 5 6
Cube To the fourth
1 1 1
2 8 16
3 27 81
4 64 256
5 125 625
6 216 1296
7 343 2401
8 512 4096
9 729 6561
10 1000 10000
Their ages can't end with 0, 1, 5 or 6.
See this spreadsheet: https://docs.google.com/spreadsheets/d/1rEkYk8uShyQ8gPfwTC4Losp-RPzNIYgvMo2nu0NMV4M/edit?usp=sharing
Gauss's age is easy. Since 17^3=4913, 17^4=83521, 22^3=10648, 22^4=234256, Gauss's age is between 18 and 21. The only possibility is 18. 18^3=5832, 18^4=104976.
The professor's age is a little harder. It can be 47 to 99, and the possibilities are: 48, 53, 54, 57, 62, 63, 69, 72, 78, 84, 87, 89, 93, 98, 99. By trial and error, 69 satisfies this condition: 69^2=4761, 69^3=328509.
Therefore, Gauss was 18 and the professor was 69.