Small prime: 97
- Input
- 97
- Expected output
- primo (fatoração: 97)
Only divisors up to 9 need testing, since √97 ≈ 9.85; no number from 2 to 9 divides 97 evenly.
prime numbers and factorization
A prime number has exactly two positive divisors, 1 and itself. This page shows why testing divisors only up to the square root of the number is enough to decide that, which test the tool actually runs under the hood, and the classic trap that fools simpler primality tests.
Only divisors up to 9 need testing, since √97 ≈ 9.85; no number from 2 to 9 divides 97 evenly.
221 looks like any random number, but it fails the divisibility test by 13 before ever reaching √221 ≈ 14.87; without a calculator it is easy to mistake for prime.
Successive division here would test up to 99 odd divisors (√9973 ≈ 99.86); this is the kind of number where the O(√n) cost starts to weigh noticeably by hand, though it stays instant under Miller-Rabin.
A prime number is an integer greater than 1 that has no positive integer divisors other than 1 and itself. The first primes are 2, 3, 5, 7, 11, 13…
No. The definition of prime requires exactly two distinct positive divisors, 1 and itself; the number 1 has only one divisor (itself), so it sits in its own category, neither prime nor composite, and the tool flags that case separately from the "prime" status.
Yes, and it is the only one: every other even number is divisible by 2 in addition to 1 and itself, which already gives three divisors and rules out primality; that is why 2 gets a shortcut check before any more expensive test.
10^24 (a 1 followed by 24 zeros), the point up to which the fixed witness set used here for deterministic Miller-Rabin (2 through 37) is mathematically proven correct; above that, the same witness set no longer guarantees a correct answer.
Because proving a number is prime or composite (Miller-Rabin) is far cheaper than finding the exact factors of a large composite; factorization here still uses successive division, O(√n), so a composite with its largest prime factor near √n can take noticeably longer than the simple primality check of that same number.
Supports positive integers up to 10²⁴.
All calculations stay in your browser. No data is sent to any server.