Positive integers $a, b$ and $c$ satisfy the system of equations

$$
\left\{\begin{aligned}
(a b-1)^{2} & =c\left(a^{2}+b^{2}\right)+a b+1 \\
a^{2}+b^{2} & =c^{2}+a b
\end{aligned}\right.
$$

(a) Prove that $c+1$ is a perfect square.
(b) Find all such triples $(a, b, c)$.

Answer: (b) $a=b=c=3$.
(a) Rearranging terms in the first equation gives

$$
a^{2} b^{2}-2 a b=c\left(a^{2}+b^{2}\right)+a b
$$

By substituting \( ab=a^{2}+b^{2}-c^{2} \) into the right-hand side and rearranging the terms we get

$$
a^{2} b^{2}+c^{2}=(c+1)\left(a^{2}+b^{2}\right)+2 a b
$$

By adding \( 2 a b c \) to both sides and factorizing we get

$$
(a b+c)^{2}=(c+1)(a+b)^{2}
$$

Now it is obvious that \( c+1 \) has to be a square of an integer.
(b) Let us say \( c+1=d^{2} \), where \( d>1 \) and is an integer. Then substituting this into the equation (10) and taking the square root of both sides (we can do that as all the terms are positive) we get

$$
a b+d^{2}-1=d(a+b)
$$

We can rearrange it to \( (a-d)(b-d)=1 \), which immediately tells us that either \( a=b=d+1 \) or \( a=b=d-1 \). Note that in either case \( a=b \). Substituting this into the second equation of the given system we get \( a^{2}=c^{2} \), implying \( a=c \) (as \( a, c>0 \)).

- If \( a=b=d-1 \), then \( a=c \) gives \( d-1=d^{2}-1 \), so \( d=0 \) or \( d=1 \), neither of which gives a positive \( c \), so cannot be a solution.
- If \( a=b=d+1 \), then \( a=c \) gives \( d+1=d^{2}-1 \), so \( d^{2}-d-2=0 \). The only positive solution is \( d=2 \) which gives \( a=b=c=3 \). Substituting it once again into both equations we indeed get a solution.