Problem:
For how many ordered pairs (x,y) of integers is it true that 0<x<y<106 and that the arithmetic mean of x and y is exactly 2 more than the geometric mean of x and y?
Solution:
From
2x+y​=2+xy​
it follows that
x+y−2xy​(y​−x​)2y​−x​​=4=4, and =2.​
Because y=(2+x​)2=x+4+4x​ is an integer, it follows that 4x​ must be an integer. Consequently 16x is a perfect square, and x​ is an integer. From (2+x​)2<106, it follows that x​<998. Thus the 997 solutions are (x,y)=(n2,(n+2)2), for n=1,2,…,997​.