Sorry for my poor english. I run code on my pc with different params. Where may be error? Test alltime is wrong. See screenshot: http://rghost.ru/59087997/image.png
I found my error. I was searched all multiples of i<=LIMIT, whereas right i*i<=LIMIT. Now my code not run firsth test..but i am sure that result is correct. Please, give me some input data for test.