正在载入教学内容...
Quick Check
Enter any integer (very large values are supported). We use Fermat tests to decide if it is probably prime.
Waiting for input
We will show the result and the reasoning.
Algorithm Steps (short)
- Eliminate obvious composites: n < 2, even numbers, or divisible by small primes.
- Run Fermat tests for several bases a: check a^(n-1) mod n = 1.
- If any test fails, n is composite; if all pass, n is probably prime.
Algorithm Behind It
The explanation is written in Markdown and rendered here. You can edit the content files directly.