Skip to content
BombersFM

Prime Number Checker

Check whether a number is prime, get its smallest factor, see neighbouring primes and the gap between them, and count primes up to n.

Is prime? (1 = yes, 0 = no)

1

Breakdown

Smallest prime factor
97
n ÷ smallest factor
0
Previous prime
89
Next prime
101
Gap to next prime
4
Primes ≤ n, π(n)
25
Sum of all divisors
98
Perfect number? (1 = yes)
0

Last updated:

Was this calculator helpful?
Advertisement

FAQ

How can I tell if a number is prime?

Trial division: test 2, then odd numbers up to √n. If nothing divides n, it's prime. √97 ≈ 9.8, so testing 2, 3, 5, 7 suffices — four divisions instead of ninety-six.

Why stop at the square root?

Divisors pair up: if n = a × b and a > √n, then b < √n and you'd have found b first. Every composite has a witness at or below its square root.

What is π(n) good for?

π(n) counts primes up to n and feeds the prime number theorem: π(n) ≈ n / ln n. Of the first million integers, 78,498 are prime — about 1 in 12.6, matching 1/ln(10⁶) = 0.0724 closely.

Related Calculators