Coding challenge

For $a\le 150$ and $b\le 1000$, write some code to show that if $a^2+b^2=q(ab+1)$, then $q$ is a perfect square. (Ref: Engel, p. 229.)

Type your code here:


Lua reference

See your results here: