Numbers

Prime Number Checker

Check whether any number is prime with step-by-step working. The calculator tests divisibility up to the square root of the number — the most efficient method — and shows every check it performs.

Is 17 prime?

Prime

How it works

  1. Find the square root (test limit)

    174.12\sqrt{17} \approx 4.12

    We only need to test divisors up to √17 ≈ 4.12. If no divisor is found up to this point, the number is prime.

    Result:Test up to 4
  2. Test divisibility by 3

    17÷3=5 remainder 217 \div 3 = 5 \text{ remainder } 2

    17 ÷ 3 = 5 remainder 2. Not divisible.

  3. Test divisibility by 5

    17÷5=3 remainder 217 \div 5 = 3 \text{ remainder } 2

    17 ÷ 5 = 3 remainder 2. Not divisible.

  4. Conclusion

    No divisors found up to 4. 17 has exactly two factors: 1 and 17. Therefore 17 is prime.

    Result:Prime

The formula

Test divisors d where 2dn\text{Test divisors } d \text{ where } 2 \leq d \leq \sqrt{n}
nnThe number to test
n√nSquare root of n — only need to test up to this value

Example substitution

174.1test 2,3,4 only\sqrt{17} \approx 4.1 \Rightarrow \text{test } 2, 3, 4 \text{ only}

For 17, only need to test divisors 2, 3, 4. None divide exactly, so 17 is prime.

Worked examples

Check whether 37 is a prime number.

  1. 1
    Test limit: √37 ≈ 6.08
  2. 2
    Test 2: 37 ÷ 2 = 18.5 ✗
  3. 3
    Test 3: 37 ÷ 3 = 12.3 ✗
  4. 4
    Test 5: 37 ÷ 5 = 7.4 ✗
Answer: Prime

Check whether 91 is a prime number.

  1. 1
    Test limit: √91 ≈ 9.5
  2. 2
    Test 7: 91 ÷ 7 = 13 ✓
  3. 3
    Factors found: 91 = 7 × 13
Answer: Not prime

Is 2 a prime number?

  1. 1
    Test limit: √2 ≈ 1.41 — no divisors to test
  2. 2
    Result: 2 is the only even prime
Answer: Prime

Frequently asked questions

What is a prime number?+

A prime number has exactly two factors: 1 and itself. Examples: 2, 3, 5, 7, 11, 13. Note: 1 is not prime.

How do you check if a number is prime?+

Test divisibility by every prime up to the square root of the number. If none divide it exactly, it is prime.

Is 1 a prime number?+

No. 1 has only one factor (itself), so it does not meet the definition of a prime number, which requires exactly two factors.

What is the smallest prime number?+

2 — it is the only even prime number. All other even numbers are divisible by 2 and are therefore not prime.

Related calculators