Where "fast" is defined as "involves disk reads" and "prime numbers" should have the qualifier "under 200." The algorithm is brute force testing of all values up to sqrt(n), which is worse than the one the ancient Greeks used.
(And yes, it does fit better.)
Cheers.