(1) print “done”

(2) n = 3 (or greater)

for a,b,c taking all possible integers

if a^n + b^n = c^n then print “done” and exit

(1) and (2) would only be equivalent if Fermat’s last theorem was wrong, and your program would be able to prove this.

In a more practical scenario, you could assume that since the number of integers you can try is limited (by the type, or by the memory), (2) will finish at some point and allow you to conclude, not actually proving that there is no solution for the n you chose.

If you can assume that both programs finish, it becomes easier, since you can emulate both and see the result.

Another restriction that makes it tractable is to assume a memory limit for the programs. This will give a finite number of configurations, and allow you to determine it a program will finish or not. Anyways, that is quite expensive, since you have to keep track of all the possible states that arise within the acceptable parameters.

Good luck with the challenge, it will be very interesting to know how the proposed solutions work under tricky cases, and which heuristics they implement :-).

]]>But Bentley’s Book always give me some insight.

The other important book for every programmer is Miyamoto Musashi’ Five Circles ;) ]]>