The quadratic Frobenius test (QFT) is a probabilistic primality test to determine whether a number is a probable prime. It is named after Ferdinand Georg Frobenius. The test uses the concepts of quadratic polynomials and the Frobenius automorphism. It should not be confused with the more general Frobenius test using a quadratic polynomial – the QFT restricts the polynomials allowed based on the input, and also has other conditions that must be met. A composite passing this test is a Frobenius pseudoprime, but the converse is not necessarily true.
Grantham's stated goal when developing the algorithm was to provide a test that primes would always pass and composites would pass with a probability of less than 1/7710.[1]
The test was later extended by Damgård and Frandsen to a test called extended quadratic Frobenius test (EQFT).[2]
Let be a positive integer such that is odd, and let b and c be integers such that
\left( | b2+4c |
n |
\right)=-1
\left( | -c |
n |
\right)=1
\left( | ⋅ |
⋅ |
\right)
B=50000
(1) Test whether one of the primes less than or equal to the lower of the two values
B
\sqrt{n}
(2) Test whether
\sqrt{n}\inZ
(3) Compute
xn+1\bmod(n,x2-bx-c)
xn+1\notinZ /nZ
(4) Compute
xn+1\bmod(n,x2-bx-c)
xn+1\not\equiv-c
(5) Let
n2-1=2rs
xs\not\equiv1\bmod(n,x2-bx-c)
2js | |
x |
\not\equiv-1\bmod(n,x2-bx-c)
0\leqj\leqr-2
If the QFT does not stop in steps (1)–(5), then is a probable prime.
(The notation
A\equivB\bmod(n,f(x))
A-B=H(x) ⋅ n+K(x) ⋅ f(x)