<s>[INST] Solve this equation $xy-\frac{(x+y)^2}{n}=n-4$ Let $n>4$ be a given positive integer. Find all pairs of positive integers $(x,y)$ such that
$$xy-\dfrac{(x+y)^2}{n}=n-4$$
What I tried is to use
$$nxy-(x+y)^2=n^2-4n\Longrightarrow (n-2)^2+(x+y)^2=nxy+4$$
 [/INST] 
Note: For symmetry, it is best to do the minor change of variables $n=m+2$. 

When dealing with integer solutions to quadratic forms, there may be a Pell equation lurking nearby. For any integer $m>2$, the equation,
$$xy-\frac{(x+y)^2}{m+2}=m-2$$
has an infinite number of positive integer solutions. Define $D = m^2-4$, then 
$$x =  (m^2-2)(p^2+Dq^2)-2Dmpq\tag1$$
and the variable $y$ as either,
$$y_1 = m(p^2+Dq^2)-2Dpq\tag{2a}$$
or,
$$y_2 =m(m^2-3)(p^2+Dq^2)-2D(m^2-1)pq\tag{2b}$$
where $p,q$ solve the Pell equation,
$$p^2-Dq^2=k,\;\;\text{where}\; k = 1\;\text{or}\; 4\tag3$$
The case $k=1$ is routine to solve. If we choose $k=4$, then $(3)$ has an infinite family of parametric solutions. For example: $p,q = m^2-2,\; m$ yields (after letting $m=n-2$),
$$x,\, y_1,\, y_2 = n^2-4n+2,\;(n^2-4n+1)(n-2),\;n-2$$
which is the first parameterization found by MacLeod in his answer while the next $p,q = m^3-3m,\; m^2-1$ gives,
$$x = n^4-8n^3+20n^2-16n+2$$
which is his second. Since $p^2-(m^2-4)q^2 = 4$ has an infinite number of parameterizations, then so does $x,y$ as MacLeod has suggested.  
</s>