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:
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
Percentage Calculator
→Calculate percentages three ways: what is X% of Y, X is what percent of Y, and Y increased or decreased by X%.
Percentage Change Calculator
→Calculate the percentage increase or decrease between two values, with the absolute difference and direction.
Percentage Difference Calculator
→Find the percentage difference between two values relative to their average — the symmetric comparison used in science and engineering.
Discount Calculator
→Calculate the sale price after a discount, how much you save, and the final price with sales tax included.