I have the following problem:
Find all $n$ that are natural numbers such that $\sqrt{n}+\sqrt{n+m}\in\mathbb{N}$, where $m$ is a positive natural number that is the product of two primes that are not equal to each other.
I thought that I can solve it when the function under the square roots are squares of integers but I have no idea how to prove that or how to continue.
Solution:
Notice that when $\text{n}$ and $\text{n}+\text{m}$ are both perfect squares, the requirements are met.
So, let $\text{n}=\text{y}^2$ and $\text{n}+\text{m}=x^2$. Than we know that:
$$x^2-\text{y}^2=\left(x+\text{y}\right)\left(x-\text{y}\right)=\text{n}+\text{m}-\text{n}=\text{m}\tag1$$
Now, let's look at a few cases:
Write $\left(x+\text{y}\right)\left(x-\text{y}\right)=\text{m}$ as: $\left(x+\text{y}\right)\left(x-\text{y}\right)=\text{m}\cdot 1$. Because we know that $x$, $\text{y}$ and $\text{m}$ are positive integers we also know that:
$$ \begin{cases} x+\text{y}=\text{m}\\ \\ x-\text{y}=1 \end{cases}\space\space\space\Longleftrightarrow\space\space\space\begin{cases} x=\frac{\text{m}+1}{2}\\ \\ \text{y}=\frac{\text{m}-1}{2} \end{cases}\tag2 $$
This implies that:
$$\text{n}=\text{y}^2=\left(\frac{\text{m}-1}{2}\right)^2\tag3$$
So, we get:
$$\sqrt{\text{n}}+\sqrt{\text{n}+\text{m}}=\sqrt{\left(\frac{\text{m}-1}{2}\right)^2}+\sqrt{\left(\frac{\text{m}-1}{2}\right)^2+\text{m}}=$$ $$\sqrt{\left(\frac{\text{m}-1}{2}\right)^2}+\sqrt{\left(\frac{\text{m}+1}{2}\right)^2}=\frac{\text{m}-1}{2}+\frac{\text{m}+1}{2}=\text{m}\tag4$$
Write $\left(x+\text{y}\right)\left(x-\text{y}\right)=\text{m}$ as: $\left(x+\text{y}\right)\left(x-\text{y}\right)=\text{p}_1\cdot\text{p}_2$. Because we know that $x$, $\text{y}$ and $\text{m}$ are positive integers we also know that:
$$ \begin{cases} x+\text{y}=\text{p}_2\\ \\ x-\text{y}=\text{p}_1 \end{cases}\space\space\space\Longleftrightarrow\space\space\space\begin{cases} x=\frac{\text{p}_1+\text{p}_2}{2}\\ \\ \text{y}=\frac{\text{p}_2-\text{p}_1}{2} \end{cases}\tag5 $$
This implies that:
$$\text{n}=\text{y}^2=\left(\frac{\text{p}_2-\text{p}_1}{2}\right)^2\tag6$$
So, we get:
$$\sqrt{\text{n}}+\sqrt{\text{n}+\text{m}}=\sqrt{\left(\frac{\text{p}_2-\text{p}_1}{2}\right)^2}+\sqrt{\left(\frac{\text{p}_2-\text{p}_1}{2}\right)^2+\text{p}_1\cdot\text{p}_2}=$$ $$\sqrt{\left(\frac{\text{p}_2-\text{p}_1}{2}\right)^2}+\sqrt{\left(\frac{\text{p}_1+\text{p}_2}{2}\right)^2}=\frac{\text{p}_2-\text{p}_1}{2}+\frac{\text{p}_1+\text{p}_2}{2}=\text{p}_2\tag7$$