If $ab+1 = r^2$ for $a,b,r \in \mathbb{N},$ how to show that $\gcd(2a(r+b)+1,2b(r+a)+1) = 1?$ Let $a<b$ be positive integers such that $ab+1 = r^2$ for some $r \in \mathbb{N}.$ If $m_1 = 2a(r+b)+1$ and $m_2 = 2b(r+a)+1.$ I want to find the possible values of $\gcd(m_1,m_2).$ I had taken some examples in the range $a,b\in\{1,2,\dots 1000\},$ and found the corresponding values as $\gcd(m_1,m_2) = 1.$ Is $\gcd(m_1,m_2) = 1$? If yes, how to prove it? If no, provide a counter example.Only thing that I could see is $\gcd(a,r)=\gcd(b,r) = 1.$

We are given that $ab+1=r^{2}$.
Note
$$2a(r+b)+1 = 2ar + 2ab+1 = 2ar+2r^2-1$$
$$2b(r+a)+1= 2br+2r^2-1$$
We claim that the gcd of the above two quantities is $1$.
$\textbf{For proof by contradiction}$ suppose that there is some prime $p$ that divides both $2ar+2r^2-1$ and $2br+2r^2-1$. Then note that $ p \not \div 2r, p \not \div a, p \not \div b$.
If $p \div 2r^2-1$, then $p|a$ and $p|b$, but $(ab, 2r^2-1) = (r^2-1,2(r^2-1)+1) = 1$ $\Rightarrow$ Thus $p \not \div 2r^2-1$
From $2ar+2r^2-1 \equiv 0 \mod p$ we get $a \equiv (1-2r^2)(2r)^{-1}\mod p $
From $ab = r^2 -1$ we get $b \equiv (r^2-1)(a)^{-1} \equiv (2r^3-2r)(1-2r^2)^{-1} \mod p$
Note that we also have $a \equiv b \mod p$ as $2ar+2r^2-1 \equiv 2br+2r^2-1 \mod p$. Thus
$$(1-2r^2)(2r)^{-1} \equiv (2r^3-2r)(1-2r^2)^{-1} \mod p$$
$$ \Rightarrow (1-2r^2)^2 \equiv 4r^4-4r^2 \mod p$$
$$\Rightarrow 1 \equiv 0 \mod p$$
Which is impossible.
