Find all positive integers $n$, such that $(\left\lfloor \sqrt{n} \right\rfloor^{2} +2) | (n^2 + 1) $ I tried to look at the cases when $n$ is a perfect square. Then $\left\lfloor \sqrt{n} \right\rfloor^{2} +2= n+2$, $ n^2 + 1 =(n-2)(n+2) + 5$. Then we must have $(n+2)|5$.
But only $1$ and $5$ divide $5$. Thus, $n=3$, but that is not a solution since we assumed $n$ to be a perfect square. The problem therefore has no perfect-square solutions.
I'm not sure how relevant this is to the general case, but I did not manage to get any further.
Thank you for your help in advance.

Without knowing the source of the problem, I give here only a hint toward the solution.

Write $m = \lfloor n\rfloor$, so that $m^2 \leq n < (m + 1)^2$.
Write $n = m^2 + r$, so that $0\leq r \leq 2m$.
The condition then becomes $m^2 + 2 \mid (m^2 + r)^2 + 1$, which is equivalent to $m^2 + 2 \mid (r - 2)^2 + 1$.
