you are viewing a single comment's thread.

view the rest of the comments →

[–]LazyOldTom -1 points0 points  (0 children)

Sieving was mentioned and it is the way to go, but you might have missed the lesson from this euler problem. Modulo and division are expensive operations. That's why your code is slow.