Question 761962
For any number k,

all values of n in the range (k-1)^2 and (k+1)^2 will satisfy the condition, where sqrt(n) would differ from k by less than 1.

How many numbers are there between k^2 and (k+1)^2?

{{{(k+1)^2 - k^2 = 2*k + 1}}}

How many numbers are there between k^2 and (k-1)^2?

{{{(k)^2 - (k-1)^2 = k^2 - (k^2 - 2k + 1) = 2*k - 1}}}

Sum of the two = {{{4*k}}}

However, this list of 4k numbers also includes k twice. So we have to reduce it by 1.

So, total possible values of n where sqrt(n) differs from k by less than 1,

is {{{highlight(4*k - 1)}}}

:)


Check a few samples:
For k = 2, the set of n would be sqrt(2) to sqrt(8) = 7 numbers = 4*2 - 1
For k = 3, the set of n would be sqrt(5) to sqrt(15) = 11 numbers = 4*3 - 1
For k = 5, the set of n would be sqrt(17) to sqrt(35) = 19 numbers = 4*5 - 1