How to use this calculator
Classify an unsigned 64-bit integer using deterministic Miller–Rabin bases valid for that bounded range.
- Enter Unsigned decimal integer. Match the units shown beside each field and review the result together with the assumptions below.
- Read the worked example below to check the expected input format and result.
- Compare another scenario by changing one input at a time. Use Reset to return to the starting values.
Deterministic unsigned 64 bit primality test explained
For an unsigned integer below 2⁶⁴, this test first checks small prime divisors, then applies strong Miller–Rabin rounds using the fixed seven-base set documented for this range. The result is deterministic only within that bound.
Inputs, symbols, and units
n— Unsigned decimal integer- Unsigned decimal integer.
Formula and method
Write n−1 = 2ˢd with d odd. For each base a in {2, 325, 9375, 28178, 450775, 9780504, 1795265022}, test aᵈ mod n and its repeated squares. A witness proves compositeness; passing all seven bases proves primality for 0 ≤ n < 2⁶⁴.
The decomposition uses exact BigInt modular arithmetic. The seven-base guarantee does not extend to n ≥ 2⁶⁴, and the result is a classification rather than a factorization.
A worked scenario
Unsigned decimal integer = 18446744073709551557.
- Primality classification: Prime
The sample is 2⁶⁴−59, within the unsigned 64-bit range. The fixed-base test classifies it as prime; no floating-point approximation is used.
Assumptions and edge cases
Exact BigInt modular arithmetic; the deterministic claim applies only below 2⁶⁴. This does not produce a factorization.
Frequently asked questions
Is a prime result probabilistic?
For the specified bounded range and base set, the test is deterministic.
Can I enter more than 64 bits?
No, a larger range requires another guarantee.
Are zero and one prime?
No.
How do I use the Deterministic unsigned 64 bit primality test calculator?
Enter Unsigned decimal integer. Match the units shown beside each field and review the result together with the assumptions below.
What is a worked example of Deterministic unsigned 64 bit primality test?
Unsigned decimal integer = 18446744073709551557. Primality classification: Prime The sample is 2⁶⁴−59, within the unsigned 64-bit range. The fixed-base test classifies it as prime; no floating-point approximation is used.
Method reference: Miller–Rabin algorithm reference implementation in SymPy.
Read our calculation methodology.