Quadratic Frobenius test

From testwiki
Revision as of 03:51, 30 June 2024 by imported>Cewbot (Fixing broken anchor: 2024-02-08 #Integers modulo n→Modular arithmetic#Integers modulo m)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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.

Concept

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]Template:Rp

The test was later extended by Damgård and Frandsen to a test called extended quadratic Frobenius test (EQFT).[2]

Algorithm

Let Template:Mvar be a positive integer such that Template:Mvar is odd, and let b and c be integers such that (b2+4cn)=1 and (cn)=1, where () denotes the Jacobi symbol. Set B=50000. Then a QFT on Template:Mvar with parameters (Template:Mvar, Template:Mvar) works as follows:

(1) Test whether one of the primes less than or equal to the lower of the two values B and n divides Template:Mvar. If yes, then stop: Template:Mvar is composite.
(2) Test whether n. If yes, then stop: Template:Mvar is composite.
(3) Compute xn+12mod(n,x2bxc). If xn+12/n, then stop: Template:Mvar is composite.
(4) Compute xn+1mod(n,x2bxc). If xn+1≢c, then stop: Template:Mvar is composite.
(5) Let n21=2rs with Template:Mvar odd. If xs≢1mod(n,x2bxc), and x2js≢1mod(n,x2bxc) for all 0jr2, then stop: Template:Mvar is composite.

If the QFT does not stop in steps (1)–(5), then Template:Mvar is a probable prime.

(The notation ABmod(n,f(x)) means that AB=H(x)n+K(x)f(x), where H and K are polynomials.)

See also

References

Template:Reflist

Template:Number-theoretic algorithms