Coding challenge

Write some code to find the maximal value of $m^2+n^2$ if $m$ and $n$ are integers between 1 and 1981 that satisfy $(n^2-mn-m^2)^2=1$. (From Andreescu, p. 63.)

Type your code here:

Lua reference

See your results here:

Show a friend, family member, or teacher what you've done!

Here is a share link to your code: