7919 is the 1000th prime
- Number
- 7,919
Result7919 is prime.
known value: 7919 is the 1000th prime
Open this exampleWhether a number is prime, and if not, its smallest factor. Trial division only up to the square root, which is all that is ever needed.
Also called: is this number prime, prime test.
If a number has a factor larger than its square root, it must also have one smaller, so testing beyond the square root finds nothing new. Skipping even numbers after two halves the work again.
test divisors up to sqrt(n)Each of these is asserted on every build. If a change to the engine ever moved one of these answers, the build would fail before the page could print it.
Result7919 is prime.
known value: 7919 is the 1000th prime
Open this exampleResult2 is prime, the only even prime.
boundary
Open this exampleResult1 is not prime. Primes are defined from 2 upward.
degenerate case: primes start at 2 by definition
Open this example