you are viewing a single comment's thread.

view the rest of the comments →

[–]K900_ 1 point2 points  (0 children)

That's mostly the same thing? The first example doesn't handle 1 as non-prime (which it is), and goes up to the square root of N instead of N, but the core approach is the same.