# If $ab+1$ is perfect square there is a $k$ such that $ak+1$ and $bk+1$ are perfect squares

Show that if $ab+1$ is a perfect square for positive integers $a$ and $b$, then there is a positive integer $k$ such that $ak+1$ and $bk+1$ are both perfect squares.

I tried to prove that there is a $k$ such that $\gcd(ak+1, bk+1)=1$ and $(ak+1)(bk+1)$ is a perfect square. But it gave me nothing. Any ideas?

You can take $$k=a+b-2\sqrt{ab+1}$$ For example if $ab+1=n^2$, then you get $$ak+1=a^2+n^2-1-2an+1=(a-n)^2$$and $$bk+1=n^2-1+b^2-2bn+1=(b-n)^2$$

• If $|a-b|=2$, then $k=0$ which is not a positive integer, btw. It might be better if you defined $k=a+b+2\sqrt{ab+1}$ instead, for which $ak+1=(a+n)^2$ and $bk+1=(b+n)^2$. – WE Tutorial School Mar 18 at 18:42

Just to give a path to the answer given by Ghartal there...

It's reasonably clear that $k$ is going to be dependent on both $a$ and $b$. So, taking $n$ defined by $n^2=ab+1$, we can try $k=a+b$ and see what happens:

$ak+1 = a(a+b)+1 = a^2+ab+1 = a^2+n^2$
$bk+1 = b(a+b)+1 = b^2+ab+1 = b^2+n^2$

So then it's easy to find a couple of solutions - we just need to insert $\pm 2an$ and $\pm 2bn$ respectively to make squares of the RH terms, so $k=a+b\pm2n$ will work:

$ak+1 = a(a+b\pm2n)+1 = a^2+ab{+}1\pm2an = a^2\pm2an+n^2 = (a\pm n)^2$
$bk+1 = b(a+b\pm2n)+1 = b^2+ab{+}1\pm2bn = b^2\pm2bn+n^2 = (b\pm n)^2$