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
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.