Perform highly powerful modern number theory calculations easily. Test candidate primality using advanced modular arithmetic. Discover hidden properties of composite integers with absolute ease.
Fermat's primality test stands as one of the foundational probabilistic algorithms in computational number theory and cryptographic security. By leveraging modular arithmetic properties derived from historical mathematical theorems, scientists and mathematicians can evaluate the prime status of exceptionally large integers with remarkable speed. Unlike deterministic trial division, which requires checking every possible factor up to the square root of a number, this probabilistic approach checks congruences across selected bases, drastically reducing computational overhead.
The entire mechanism rests upon Fermat's Little Theorem. Formally stated, if $p$ represents a prime number and $a$ is any integer such that $p$ does not divide $a$, then the integer $a$ raised to the power of $p - 1$ is congruent to 1 modulo $p$. In mathematical notation:
$$a^{p-1} \equiv 1 \pmod p$$
When applying this to our calculator, you supply a candidate integer $n$ and a chosen base $a$. If the evaluated result yields a remainder of 1, the number is categorized as a probable prime or pseudoprime. Conversely, any other remainder immediately proves that the candidate integer is composite.
Using our interactive tool is straightforward and intuitive. First, enter your target integer into the primary input field. Next, select an appropriate base value or choose a multi-base evaluation mode to test across several numbers simultaneously. Enable the detailed step-by-step execution log option to inspect intermediate modular exponentiation values. Finally, click the submit button to execute the calculation instantly. Review the prominent status badge displayed directly above the form for immediate results.
Despite its computational efficiency, Fermat's test is not foolproof. Certain composite integers, called pseudoprimes, successfully pass the test for specific bases. Even more challenging are Carmichael numbers, which are composite integers that pass the Fermat test for every single coprime base. Understanding these anomalies helps researchers apply advanced verification techniques like Miller-Rabin tests for bulletproof security.
Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.