To give a bit more detail on the calculations using Mathematica, this is an example of code which I used to calculate Duijvestijn's 112x112 Perfect Squared Square with 21 squares (the Perfect Squared Square with the fewest squares); I have...
To add to the above. I could not get Ubuntu 16.04 and Mathematica 10.0.02.0 (Linux) working using the solution above. However it DOES WORK with Ubuntu 16.04 and Mathematica 220.127.116.11 (Linux)
10 months later, I tried again, (i think my version of Mathematica is updated) and it worked, no problems!