I bumped into a problem asking (in essence) to figure out the value of $b$ in the following system:
$b = a - n$
$bn = a + n^2$
All $a$, $b$ and $n$ need to be positive integers. Is there a systematic way of doing it?
I have substituted the first equation into the second and arrived at $n = \frac{a\pm\sqrt{a}\sqrt{a-8}}{4}$
So I know that $a$ has to be either 8 or a perfect square at the very least. I have manually found solutions for $a=8$ and $a=9$, both of which give a value of $b=6$. I know that these are the only solutions (according to Wolfram Alpha).
I was wondering how would I know there are no more solutions and if there is a more elegant way than to manually try values. The problem did ask for $b$ (not $a$ or $n$), in case that makes things simpler somehow.
By your second equation you know $a$ is divisible by $n$. Call It $a=qn$
The First equation becomes $b=(q-1)n$. Substituting into the second equation and dividing by $n$ $$ (q-1)n=q+n $$ Or $q=\frac{2n}{n-1}$ ($n\ne1$ by direct verification)
So $b=\frac{(n+1)n}{n-1}$. This is an integer iif $n-1$ divides $n+1$ i.e. iif $n=2 \text{ or } 3$ (try prove this) that gives $b=6$