The Prime Number Checker tests whether an integer is prime, lists its positive factors, and finds the next prime after its absolute value.
How it works
The checker rejects non-integers and values outside JavaScript's safe integer range. It tests divisibility by 2 and 3, then checks candidate divisors in 6k plus or minus 1 steps up to the square root. Factors are generated and sorted separately.
Worked example
For 29, no divisor up to sqrt(29) divides evenly, so it is prime. Its next prime is 31. For 28, the factors are 1, 2, 4, 7, 14, 28, so it is not prime.
Questions
Is 1 prime?
No. A prime number has exactly two positive factors, while 1 has only one.
What happens with negative input?
Primality is checked on the entered integer, while factors and the next-prime search use its absolute value.
Can it handle very large integers?
Only within JavaScript's safe integer range. Larger values are rejected to avoid misleading arithmetic.
Limitations
This is a numeric utility, not a cryptographic primality proof for arbitrary-precision integers.