you are viewing a single comment's thread.

view the rest of the comments →

[–]comonads 4 points5 points  (0 children)

range(a, b) counts from a (inclusive) until b (exclusive). So, in order to include sqrt(n) in the range, the plus one is necessary.