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 1 of 6: Separate the square part
m=⌊n⌋≥1,n=m2+a,0≤a≤2m.m=\lfloor\sqrt n\rfloor\ge1,\quad n=m^2+a,\quad 0\le a\le2m.
Detailed analysis

Set m=floor(sqrt n) and a=n-m^2. The definition of the floor gives m^2≤n<(m+1)^2, hence 0≤a≤2m and m≥1.