# [SOLVED]Determine positive integers

#### anemone

##### MHB POTW Director
Staff member
Determine all possible integers $n$ for which $\dfrac{n^2+1}{\lfloor{\sqrt{n}}\rfloor^2+2}$ is an integer.

#### anemone

##### MHB POTW Director
Staff member
Let $m=\lfloor n \rfloor$ and $a=n-m^2$. We have $m\ge 1$ since $n\ge 1$. From $n^2+1=(m^2+a)^2+1 \equiv (a-2)^2+1 \pmod {(m^2+2)}$, it follows that the condition of the problem is equivalent to the fact that $(a-2)^2+1$ is divisible by $m^2+2$. Since we have

$0<(a-2)^2+1\le max{2^2,\,(2m-2)^2}+1\le 4m^2+1<4(m^2+2)$,

we see that $(a-2)^2+1=k(m^2+2)$ must hold with $k=1,\,2$ or $3$. We will show that none of these can occur.

Case 1: When $k=1$.

We get $(a-2)^2-m^2=1$ and this implies that $a-2=\pm 1$, $m=0$ must hold, but this contradicts with fact $m\ge 1$.

Case 2: When $k=2$.

We get $(a-2)^2+1=2(m^2+2)$ in this case, but any perfect square is congruent to 0, 1, 4 mod 8 and therefore we have $(a-2)^2+1\equiv 1,\,2,\, 5 \pmod {8}$ while $2(m^2+2)\equiv 4,\,6 \pmod {8}$. Thus, this case cannot occur either.

Case 3: When $k=3$.

We get $(a-2)^2+1=3(m^2+2)$ in this case. Since any perfect square is congruent to 0 or 1 mod 3, we have $(a-2)^2+1\equiv 1,\,2 \pmod {3}$ while $3(m^2+2)\equiv 0 \pmod {8}$, which shows that this case cannot occur either. And then we are done with the proof.