Denote the integers by x and y; then
x2−xy+y2=z2 suppose;
∴x(x−y)=z2−y2.
This equation is satisfied by the suppositions
mx=n(z+y), n(x−y)=m(z−y),
where m and n are positive integers.
Hence mx−ny−nz=0, nx+(m−n)y−mz=0.
From these equations we obtain by cross multiplication
x2mn−n2=ym2−n2=zm2−mn+n2;
and since the given equation is homogeneous we may take for the general solution
x=2mn−n2, y=m2−n2, z=m2−mn+n2.
Here m and n are any two positive integers, m being the greater; thus if m=7, n=4, we have
x=40, y=33, z=37.