Eliminating non-integer solutions to $ab / (2\sqrt{ab} + a + b)$

88 Views Asked by At

I am writing a program to output all $a,b \in \mathbb{N}$, where $a \le b \le n$ (for a given $n \in \mathbb{N}$), such that

$$ \frac{ab}{2\sqrt{ab}+a+b}=c\in \mathbb{N} $$

For example, $a=9$, $b=36$, and $c=4$ satisfy this equation.

My program runs at a tolerable speed for values of $n<10^5$, but is not efficient enough for higher values. Is there anything of value from number theory that I can use to eliminate my options? For instance, I know that $\sqrt{ab} \in \mathbb{N}$ is a necessary (but not sufficient) condition.

2

There are 2 best solutions below

1
On

All solutions $(a,b)\in\mathbb{N}^2$ to the conditions $\frac{ab}{2\sqrt{ab}+a+b}\in\mathbb{N}$ and $a\leq b$ take the form $(a,b)=\left(ku^2(u+v)^2,kv^2(u+v)^2\right)$, where $k,u,v\in\mathbb{N}$ are such that $\gcd(u,v)=1$ and $u\leq v$.

1
On

To justify Batominovski claim, we start with any solution $(a,b)$ to your diophantine equation and the radical in the denominator.

$\sqrt{ab}\in\mathbb{N}$ implies we have a natural factorization of $a=u^2C$ and $b=v^2C$ that is unique when we constrain $gcd(u,v)=1$

$$ \frac{ab}{2\sqrt{ab}+a+b}\in\mathbb{N}\Leftrightarrow\frac{Cu^2v^2}{(u+v)^2}\in\mathbb{N} $$ (as Michael Burr pointed out, the denominator is a square)

Because $gcd(u,v)=1,\ (u+v)$ cannot divide any of the factors in $uv;$ so the $C$ factor must cover the entire denominator, and so we have a natural $k$ that provides $C=k(u+v)^2$

So we have Batominvoski's construction: $$ (a,b)=(ku^2(u+v)^2,kv^2(u+v)^2),\ \ k,u,v\in\mathbb{N},\ \ \gcd(u,v)=1 $$