Problem
If $a$, $b$, $q=\left(\dfrac{a^2+b^2}{1+ab}\right)$ are natural numbers, then $q$ is a perfect square. Are there infinitely many $\left(a,b,q\right)$ triplets?
I have tried to prove the problem assuming that $q$ is not a perfect square and hoped to get some contradiction but unfortunately I can't seem to get it. Regarding the second part of the problem, I think that probably it is not true. In case it is true I add the following problem to the original statement.
Can there be found expressions for $a$, $b$ and $q$ such that it generates an infinitely many (but not necessarily all) such triplets?
Any help will be appreciated.