MathLabs

Problem 2

Determine all positive integers n for which (n^2+1)/(floor(sqrt(n))^2+2) is an integer. Here floor(r) denotes the greatest integer less than or equal to r.
Step 3 of 6: Limit the possible quotient
0<(a−2)2+1<4(m2+2)⟹(a−2)2+1=k(m2+2),k∈{1,2,3}.0<(a-2)^2+1<4(m^2+2)\Longrightarrow (a-2)^2+1=k(m^2+2),\quad k\in\{1,2,3\}.
Detailed analysis

From 0≤a≤2m, the numerator is at most max{4,(2m−2)^2}+1≤4m^2+1<4(m^2+2). It is positive, so its quotient by m^2+2 must be 1, 2, or 3.