Solution:
Clearly for n=1, each pair (x,y) with x=y is a solution. Now, suppose that n>1 which implies x=y. We have
0<n−1=x2+xy+3yy2+xy+3x−1=x2+xy+3y(x+y−3)(y−x).
Since x+y≥3, we conclude that x+y>3 and y>x. Take d=gcd(x+y−3, x2+xy+3y). Then d divides x2+xy+3y−x(x+y−3)=3(x+y). Then d also divides 3(x+y)−3(x+y−3)=9, hence d∈{1,3,9}. As
n−1=dx2+xy+3ydx+y−3(y−x)
and gcd(dx+y−3, dx2+xy+3y)=1, it follows that dx2+xy+3y divides y−x, which leads to
x2+xy+3y≤dy−dx⇔x2+dx≤(d−3−x)y.
It is necessary that d−3−x>0⇒d>3, therefore d=9 and x<6. Take x+y−3=9k, k∈N∗ since d∣x+y−3 and we get y=9k+3−x. Hence
n−1=k(x+3)+1k(9k+3−2x).
Because k and k(x+3)+1 are relatively prime, the number t=k(x+3)+19k+3−2x must be integer for some positive integers x<6. It remains to consider these values of x:
1) For x=1, then t=4k+19k+1 and since 1<t<3, we get t=2, k=1, y=11, so n=3.
2) For x=2, then t=5k+19k−1 and since 1<t<2, there are no solutions in this case.
3) For x=3, then t=6k+19k−3 and since 1=t<2, there are no solutions in this case.
4) For x=4, then t=7k+19k−5<2, i.e. t=1 which leads to k=3, y=26, so n=4.
5) For x=5, then t=8k+19k−7<2, i.e. t=1 which leads to k=8, y=70, so n=9.
Finally, the answer is n∈{1,3,4,9}.