In number theory, Proth's theorem is a primality test for Proth numbers.
It states[1] [2] that if p is a Proth number, of the form k2n + 1 with k odd and k < 2n, and if there exists an integer a for which
| ||||
a |
\equiv-1\pmod{p},
then p is prime. In this case p is called a Proth prime. This is a practical test because if p is prime, any chosen a has about a 50 percent chance of working, furthermore, since the calculation is mod p, only values of a smaller than p have to be taken into consideration.
In practice, however, a quadratic nonresidue of p is found via a modified Euclid's algorithm and taken as the value of a, since if a is a quadratic nonresidue modulo p then the converse is also true, and the test is conclusive. For such an a the Legendre symbol is
\left( | a |
p |
\right)=-1.
Thus, in contrast to many Monte Carlo primality tests (randomized algorithms that can return a false positive), the primality testing algorithm based on Proth's theorem is a Las Vegas algorithm, always returning the correct answer but with a running time that varies randomly. Note that if a is chosen to be a quadratic nonresidue as described above, the runtime is constant, save for the time spent on finding such a quadratic nonresidue. Finding such a value is very fast compared to the actual test.
Examples of the theorem include:
The first Proth primes are :
3, 5, 13, 17, 41, 97, 113, 193, 241, 257, 353, 449, 577, 641, 673, 769, 929, 1153 ….
The largest known Proth prime is
10223 ⋅ 231172165+1
202705 ⋅ 221320516+1
The proof for this theorem uses the Pocklington-Lehmer primality test, and closely resembles the proof of Pépin's test. The proof can be found on page 52 of the book by Ribenboim in the references.
François Proth (1852–1879) published the theorem in 1878.[7] [8]