Hacker News new | ask | show | jobs
by Someone 1598 days ago
It’s even worse: to check whether a given number n is prime, you don’t need to know any prime.

If you do trial division in increasing order, you’ll find one (the smallest prime factor if n, which is n itself if n is prime), but if n is composite, you can avoid that by doing it in random order, or by starting near √n and working down (or up). That way, even if n has only two/three prime factors, you’ll find them/one of them, but that won’t tell you that they are/one of them is prime.