I was looking at my code, hoping to improve its performance and then i saw this: Oh, ok, i don’t really need the call to Math.floor, as casting the double returned from Math.sqrt(n) will be effectively flooring the number too (as sqrt will never return a negative number). So i went and dropped the call to Math.floor: sat back and