No, I'd never seen that one before. I worked it out as follows:
Parts 1 and 2
Compute all the squares from 1 upwards, until they become 4 digits long (I assumed that they were 3 digits and less).
Remove all those that have repeated digits like 100.
This is your "start list"
Pick the first number in the start list and then remove all other numbers with common digits from the list.
Pick the second number in the remaining list and then remove all other numbers with common digits from the list.
Etc.
Whenever you get to a "dead end" situation where the task becomes imposible you backtrack your last choice. If you cannot backtrack (because there are no more options left) you know the first number you picked was wrong so remove it from the start list and begin picking numbers again.
It only took me about 5-10 minutes to get them both after generating the start list.
Part 3
It wasn't too hard to do this with the help of a little computer program and some basic maths knowledge to help reduce the search time.
The smallest possible 9-digit number is 123456789 so calculate it's square root and begin with the next whole number x.
Compute x * x and check to see if it has common digits. If so or if it doesn't contain all the digits, then increase x by 1 and start again.
Luckily, the answer was relatively low in the search range (i.e. starts with a 1 rather than a 9!), so it only took about 700 tries.
|