MathQuarryCalculators

Primes

Check whether any number 1-500 is prime, with the reasoning shown.

A prime number has exactly two positive divisors: 1 and itself. That's the whole definition, and it's stricter than it first sounds — it rules out 1 (which has only one divisor, itself, not two) and it rules out every number with any additional divisor, however small. 2, 3, 5, 7, 11, and 13 are prime. 4 is not, because 2 divides it. 9 is not, because 3 divides it. Primality looks simple to define and is famously not simple to compute quickly for very large numbers — which is exactly why prime numbers sit at the center of modern cryptography, not despite their simple definition but because of it.

This hub indexes a dedicated prime-check page for every number from 1 to 550, each one showing a direct yes/no answer plus the actual divisibility reasoning behind it — which small primes were tested, up to the square root of the number, and (for composite numbers) the specific prime factorization that proves the number isn't prime.

The method is trial division by primes up to √n, and the square-root cutoff is the same logic as on the factors side: if n has a divisor d greater than √n, it must also have a paired divisor n/d smaller than √n, so if no divisor exists at or below √n, none can exist above it either. For checking whether 97 is prime, for example, you only need to test primes up to √97 ≈ 9.8 — so 2, 3, 5, and 7. None of them divide 97 evenly, so 97 is prime. You never need to check 11, 13, or anything larger, because if 97 had a factor that large, its pair would have to be smaller than 9.8, and none of the smaller candidates worked.

A common point of confusion is worth addressing directly: 1 is not prime. It fails the two-divisor definition (it has exactly one divisor, itself) and mathematicians deliberately exclude it — not as an arbitrary convention, but because including it would break the Fundamental Theorem of Arithmetic, which states that every integer greater than 1 has a unique prime factorization. If 1 counted as prime, you could pad any factorization with as many extra factors of 1 as you liked (12 = 2² × 3 = 2² × 3 × 1 = 2² × 3 × 1 × 1...), and "unique" would stop meaning anything. Another common trap: numbers that look prime because they're odd and don't end in 0 or 5 but actually aren't — 51 (= 3 × 17), 91 (= 7 × 13), and 119 (= 7 × 17) are the classic examples that catch people out, because none of the quick surface checks (even/odd, ends in 5) catch them.

Beyond the individual page, a few structural facts about primes are genuinely useful to know. There are infinitely many primes — this was proven by Euclid over two thousand years ago, with an elegantly short proof by contradiction. Primes get sparser as numbers get larger, but never run out. Twin primes (pairs like 11 and 13, or 17 and 19, differing by exactly 2) are a famously open area of research — it's conjectured there are infinitely many twin prime pairs, but this hasn't been proven. And the distribution of primes, while irregular in the small numbers, follows a remarkably precise average pattern at scale, described by the Prime Number Theorem.

Practically, prime checking matters far beyond math class. Cryptographic systems like RSA rely on the fact that multiplying two large primes together is fast, but factoring the resulting product back into those two primes is, for large enough numbers, computationally infeasible with current methods — that asymmetry is what keeps encrypted communication secure. On a much smaller scale, primality shows up in scheduling and design: gears with a prime number of teeth wear more evenly because they minimize repeated contact between the same two teeth.

If you're checking a specific number, search it directly and the reasoning is right there. If you want the general method so you're not dependent on a lookup, the How to Check if a Number Is Prime guide walks through the trial-division method step by step, and the companion Prime Factorization guide covers what to do once you've established a number isn't prime and need to break it down completely. As with the Factors hub, dedicated prime-check pages here stop at 550 for practical reference-range reasons, not because the method changes above that point.

Trial division is the right method for checking a single number, but it's not the most efficient way to find every prime in a range — for that, the Sieve of Eratosthenes, a method roughly 2,200 years old, is faster and worth knowing as a second technique. List every integer from 2 to 50, then cross out every multiple of 2 above 2 itself (4, 6, 8...), every multiple of 3 above 3 (6, 9, 12...), every multiple of 5 above 5, and every multiple of 7 above 7 — you can stop there, because √50 is about 7.07, the same square-root logic as trial division, just applied across an entire range at once instead of one number at a time. Whatever survives uncrossed is prime: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, and 47 — fifteen primes below 50. The sieve trades individual reasoning for elimination across a whole range, which is why it's the standard method computer programs use to generate large lists of primes, rather than testing each candidate number in isolation.

A few other structural properties of primes are worth knowing beyond the twin-prime and infinitude facts mentioned above. Mersenne primes — primes of the form 2ⁿ − 1 — sit behind essentially every record-breaking largest-known-prime discovery, because a specific, efficient test (the Lucas–Lehmer test) exists just for numbers of that exact shape, making them far more practical to check at enormous size than an arbitrary number would be; 3, 7, 31, and 127 are the first four Mersenne primes, corresponding to n = 2, 3, 5, and 7. Prime gaps — the distance between one prime and the next — grow irregularly but widen on average as numbers get larger: the gap between 2 and 3 is 1, between 7 and 11 it's 4, and by the time you reach primes in the millions, gaps of several hundred between consecutive primes are unremarkable. Twin primes (a gap of exactly 2) are about as small as a gap above 1 can get, which is part of why the open question of whether they continue infinitely often has remained such a stubborn one in number theory.

The RSA cryptography connection mentioned above is easier to feel with small numbers, even though real systems use primes hundreds of digits long. Take two small primes, 61 and 53. Multiplying them is trivial: 61 × 53 = 3,233 — that's the "public" number that would get shared openly. Going the other direction — given only 3,233, finding the two primes that multiply to it — takes real work even at this tiny size if the answer isn't already known: you'd have to test candidate divisors up to √3,233 ≈ 56.9. Scale that same asymmetry up to primes with hundreds of digits each, and multiplying them together is still nearly instant for a computer, while factoring the enormous product back apart is, with every publicly known method, computationally infeasible within a human lifetime. That gap between easy-to-multiply and hard-to-un-multiply is the entire security foundation RSA encryption rests on, not a metaphor but the literal mechanism.

For quick reference, the primes below 100 are: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, and 97 — twenty-five of them. Notice 2 is the only even prime; every other even number is automatically divisible by 2 and therefore composite, a genuinely useful first filter before doing any real division work. Beyond cryptography and gear-tooth design, primality shows up in less obvious places too: cicada broods in North America famously emerge on 13-year or 17-year cycles — both prime numbers — a pattern researchers believe evolved to minimize overlap with predator population cycles, which tend to run on shorter, non-prime periods; a prime-numbered cycle length is much harder for a predator's own reproductive cycle to fall into step with. A final misconception worth flagging directly: primality has nothing to do with how "recognizable" a number looks — 1,001 looks like it could easily be prime and isn't (it's 7 × 11 × 13), while a number with no obvious pattern at all, like 1,009, is genuinely prime. The only reliable check is the actual reasoning, never a hunch about how a number looks on the page.

For numbers too large for exhaustive trial division to be practical at all, professional primality testing switches methods entirely, trading absolute certainty for near-certainty at enormous speed. The Miller–Rabin test, for example, doesn't prove a number is prime the way trial division does; it proves a number is composite when it finds a mathematical inconsistency, and if repeated rounds of the test find no such inconsistency, the number is called a "probable prime" — wrong for a truly composite number only with vanishingly small, deliberately controllable probability. The current largest known prime, discovered through the distributed Great Internet Mersenne Prime Search project, has tens of millions of digits — far too large to ever check by simple trial division within any practical amount of time, which is exactly why the specialized Mersenne-specific test mentioned above exists. None of this changes anything for the numbers indexed on this hub; trial division up to √n is exact and fast for every value from 1 to 550. It's worth knowing the method genuinely does change once numbers grow large enough, though, rather than assuming the same simple approach scales indefinitely.

Browse prime checks 1 through 550.