Prime number checker
Is 97 prime? Yes, and the table shows why: it leaves a remainder when divided by 2, 3, 5 and 7, the only primes at or below its square root. The prime number checker takes any whole number up to a trillion.
Is it prime?
- Verdict Its only divisors are 1 and 97.
- 97 is prime
- Proof by trial division If 97 were a x b with both factors above its square root, 9.849, the product would exceed 97. So any factor pair has one member at or below 9, and finding none there proves there is none at all.
- Not divisible by 2, 3, 5 or 7
- Nearest primes 8 below and 4 above.
- 89 below, 101 above
- Prime factorization
- 97
- Expanded
- 97
- Distinct primes 1 distinct prime, 1 factor in total.
- 97
- Dividing out each prime in turn Divide by the smallest prime that goes in, repeat on the quotient, stop at 1. The divisors used are the factorization.
- 97 / 97 = 1
- Number of divisors Multiply one more than each exponent: (1 + 1) = 2. A divisor picks each prime to a power from 0 up to its exponent, so there are that many combinations.
- 2
- Sum of divisors
- 98
- All divisors
- 1, 97
- Perfect square or cube? A number is a perfect square exactly when every exponent is even, and a perfect cube exactly when every exponent is a multiple of three. The factorization answers this with no square roots taken.
- neither
| Trial divisor | Quotient | Remainder |
|---|---|---|
| 2 | 48 | 1 |
| 3 | 32 | 1 |
| 5 | 19 | 2 |
| 7 | 13 | 6 |
- 1 is not prime, by definition rather than by test: counting it would break the uniqueness of prime factorization.
- Trial division is a proof, and fast up to the trillion this form accepts. Large numbers are checked with probabilistic tests such as Miller-Rabin, which can show a number is composite with certainty but only make primality overwhelmingly likely, unless a deterministic variant or a primality certificate is used.
How the Prime Factorization Calculator works
A prime number is a whole number greater than 1 whose only divisors are 1 and itself. 2, 3, 5, 7, 11 and 13 are prime. 9 is not, because 3 divides it; neither is 91, which looks prime until you notice 7 x 13. Every whole number above 1 that is not prime is composite, and 2 is the only even prime, because every other even number has 2 as a factor.
The test: divide by every prime up to the square root. To check 97, work out its square root, about 9.85, and try each prime at or below it:
97 / 2 = 48 remainder 1 97 / 3 = 32 remainder 1 97 / 5 = 19 remainder 2 97 / 7 = 13 remainder 6
None goes in exactly, so 97 is prime. Nothing above 9 needs trying.
Why the square root is enough. If n = a x b and both a and b were bigger than the square root of n, their product would be bigger than n. So whenever a number has a factor pair, one member of the pair is at or below the square root. Search that range, find nothing, and you have proved there is no factor anywhere. For 97 that is four divisions instead of ninety-five.
Why only primes need testing. If 9 divided a number, 3 would already have divided it. A composite trial divisor is made of smaller primes that were tried first, so testing it can never find anything new. That is also why the first divisor found is always the smallest prime factor: 221 first gives way at 13, and 221 = 13 x 17. The calculator walks 2, 3 and then the numbers of the form 6k - 1 and 6k + 1, because every prime above 3 has that form.
Why 1 is not prime. It has only one divisor, and it is excluded by definition so that every number has exactly one prime factorization. If 1 counted, 6 would be 2 x 3 and also 1 x 2 x 3, and the fundamental theorem of arithmetic would fail. 0 is not prime either: every number divides it.
How far this goes. Trial division is a proof, and fast for anything this form accepts, up to a trillion: at most about 333,000 divisions. For numbers with hundreds of digits it is hopeless, and computers use probabilistic tests instead. The Miller-Rabin test checks a property every prime has; a number that fails it is certainly composite, and one that passes many rounds is prime with overwhelming probability. Deterministic tests and primality certificates exist where certainty is required, as it is when generating keys for RSA encryption, which multiplies two large primes together.
The record for the largest known prime has for decades been held by a Mersenne prime, a number of the form 2^p - 1. Those have a fast special-purpose test (Lucas-Lehmer) and are hunted by a distributed volunteer project, and recent records run to millions of digits. Euclid proved more than two thousand years ago that the primes never run out, so there will always be a larger one to find.
Prime Factorization Calculator FAQ
Is 97 a prime number?
Yes. Its square root is about 9.85, and none of the primes at or below that (2, 3, 5 and 7) divides 97 exactly. A number with no prime factor up to its square root has no factor at all, so 97 is prime.
How do you check if a number is prime?
Divide it by each prime up to its square root. If any divides exactly, the number is composite and that prime is its smallest factor. If none does, it is prime. For 221, the square root is about 14.9, and 13 divides it: 221 = 13 x 17.
Is 1 a prime number?
No. A prime has exactly two divisors, 1 and itself, and 1 has only one. It is excluded on purpose so that every whole number above 1 has a single prime factorization; if 1 were prime, 6 = 2 x 3 = 1 x 2 x 3 would have several.
Why is 2 the only even prime?
Every even number is divisible by 2. For 2 itself that is the number dividing itself, which is allowed; for 4, 6, 8 and every larger even number it is a divisor other than 1 and the number, so they are all composite.
What is the largest known prime number?
It changes when a new one is found, so this calculator does not quote a figure. The record has for decades been a Mersenne prime, 2^p - 1, found by a distributed computing project, and recent records have millions of digits. There is no largest prime: Euclid proved there are infinitely many.