Prime Number Calculator

Test a whole number for primality and meet its neighbouring primes.

A whole number from 1 to 1 000 000 000 000

Try

Result

You enteredn=1000000007n = 1000000007

1000000007 is prime\displaystyle \text{1000000007 is prime}

Next prime

1000000009\displaystyle 1000000009

Previous prime

999999937\displaystyle 999999937
Show the work
  1. Test divisors up to the square root

    If 10000000071000000007 had a factor larger than its square root, it would be paired with a smaller one, so it is enough to test every prime up to it. None of them divides 10000000071000000007 exactly.

    ⌊1000000007⌋=31622\lfloor\sqrt{1000000007}\rfloor = 31622
  2. Result

    So 10000000071000000007 is prime: its only factors are 11 and 10000000071000000007.

Worked examples