This problem begs to be solved by brute force, but I was just wondering what it would look like if we tried to solve it analytically? I gave it a start, not sure how much further I could go with it.
It's obvious to start that we need to find n such that n^2 contains 4 digits and n^3 contains 6 digits. The cube root of 100,000 is ~46.4 so n must be greater than 46 and less than 100.
The sum of all digits from 0 through 9 is 0 mod 3, so n cannot be 1 mod 3, since n^2 and n^3 would both be 1 mod 3 and then the sum of their digits would be 2 mod 3.
n cannot end in a 0, 1, 5 or 6 since n^2 and n^3 would each end in the same digit.
We've already ruled out a pretty large chunk of numbers. From there I started looking at the leftmost digits of the square roots of thousands (1000, 2000, etc) and the cube roots of hundredthousands. We can rule out 89 (they'd both start with 7), 9394 (they'd both start with 8) and 9799 (they'd all start with 9).
Similarly we can rule out n = 68 since n^2 would start and end with a 4, and n = 74 since n^3 would start and end with a 4.
We can rule out 48, 57, and 92 because n^3 would end in the same digit that n^2 starts with. We can rule out 78 because n^2 would end in the same digit that n^3 starts with.
Now the list of potential candidates has been whittled down to the following 12:
47
53
54
59
62
63
69
72
77
83
84
87
At this point I don't know if there's a good way to continue pruning the list, though at least it's now at a length you could feasibly bruteforce by hand as opposed to using software.

Posted by tomarken
on 20210407 08:05:55 