Prove that $\alpha$ and $\beta$ are integers if and only if $\lfloor m \alpha \rfloor + \lfloor m \beta \rfloor$ is the square of an integer

Let $m$ and $n$ be positive integers such that $x^2 − mx + n = 0$ has real roots $\alpha$ and $\beta$. Prove that $\alpha$ and $\beta$ are integers if and only if $\lfloor m \alpha \rfloor + \lfloor m \beta \rfloor$ is the square of an integer.

My attempt is below and I would like to know if there should be any improvements to it or if it is good.

Attempt

Instead of solving for $\alpha$ and $\beta$, we can use Vieta's. Then $x^2 − mx + n = 0$ has real roots that are integers if and only if $\alpha$ and $\beta$ are real and $m = \alpha + \beta, n = \alpha \beta$. Then $$\lfloor m \alpha \rfloor + \lfloor m \beta \rfloor = \lfloor (\alpha + \beta) \alpha \rfloor + \lfloor (\alpha + \beta) \beta \rfloor = \lfloor \alpha^2 \rfloor +\lfloor \beta^2 \rfloor+2n = \alpha^2+\beta^2+2\alpha\beta = (\alpha+\beta)^2.$$ Thus this must be the square of an integer and we are done.

• Yes, it’s correct, though for completeness I would add one more step at the end of the chain: $(\alpha+\beta)^2=m^2$. Feb 19, 2016 at 20:33
• I would be careful here, the $\lfloor \alpha^2 \rfloor = \alpha^2$ is okay when $\alpha$ is integer, but it does not hold for general $\alpha$. It is valid for "$\Rightarrow$" direction. For the other direction I think you need to show more, but maybe I am missing something.
– Sil
Feb 19, 2016 at 21:26