In number theory, a Frobenius pseudoprime is a pseudoprime, whose definition was inspired by the quadratic Frobenius test described by Jon Grantham in a 1998 preprint and published in 2000. Frobenius pseudoprimes can be defined with respect to polynomials of degree at least 2, but they have been most extensively studied in the case of quadratic polynomials.
Definition of Frobenius pseudoprimes with respect to a monic quadratic polynomial , where the discriminant is not a square, can be expressed in terms of Lucas sequences and as follows.
A composite number n is a Frobenius pseudoprime if and only if
where is the Jacobi symbol.
When condition (2) is satisfied, condition (3) becomes equivalent to
Therefore, Frobenius pseudoprime n can be equivalently defined by conditions (1-2) and (3), or by conditions (1-2) and (3′).
Since conditions (2) and (3) hold for all primes which satisfy the simple condition (1), they can be used as a probable prime test. (If condition (1) fails, either the greatest common divisor is less than n, in which case it is a non-trivial factor and n is composite, or the GCD equals n, in which case you should try different parameters P and Q which are not multiples of n.)
Every Frobenius pseudoprime is also
Converse of neither of these statements is true, making the Frobenius pseudoprimes a proper subset of each of the sets of Lucas pseudoprimes and Dickson pseudoprimes with parameters , and Fermat pseudoprimes base when . Furthermore, it follows that for the same parameters , a composite number is a Frobenius pseudoprime if and only if it is both Lucas and Dickson pseudoprime. In other words, for every fixed pair of parameters , the set of Frobenius pseudoprimes equals the intersection of the sets of Lucas and Dickson pseudoprimes.
While each Frobenius pseudoprime is a Lucas pseudoprime, it is not necessarily a strong Lucas pseudoprime. For example, 6721 is the first Frobenius pseudoprime for , which is not a strong Lucas pseudoprime.
Every Frobenius pseudoprime to is also a restricted Perrin pseudoprime. Analogous statements hold for other cubic polynomials of the form .
Frobenius pseudoprimes with respect to the Fibonacci polynomial are determined in terms of the Fibonacci numbers and Lucas numbers . Such Frobenius pseudoprimes form the sequence:
While 323 is the first Lucas pseudoprime with respect to the Fibonacci polynomial , the first Frobenius pseudoprime with respect to the same polynomial is 4181 (Grantham stated it as 5777 but multiple authors have noted this is incorrect and is instead the first pseudoprime with for this polynomial).
Another case, Frobenius pseudoprimes with respect to the quadratic polynomial can be determined using the Lucas sequence and are:
In this case, the first Frobenius pseudoprime with respect to the quadratic polynomial is 119, which is also the first Lucas pseudoprime with respect to the same polynomial. Besides, .
The quadratic polynomial , i.e. , has sparser pseudoprimes as compared to many other simple quadratics. Using the same process as above, we get the sequence:
Notice there are only 3 such pseudoprimes below 500000, while there are many Frobenius (1, −1) and (3, −1) pseudoprimes below 500000.
Every entry in this sequence is a Fermat pseudoprime to base 5 as well as a Lucas (3, −5) pseudoprime, but the converse is not true: 642001 is both a psp-5 and a Lucas (3,-5) pseudoprime, but is not a Frobenius (3, −5) pseudoprime. (note that Lucas pseudoprime for a (P, Q) pair need not to be a Fermat pseudoprime for base |Q|, e.g. 14209 is a Lucas (1, −3) pseudoprime, but not a Fermat pseudoprime for base 3.
Strong Frobenius pseudoprimes are also defined. Details on implementation for quadratic polynomials can be found in Crandall and Pomerance.
The conditions defining Frobenius pseudoprime can be used for testing a given number n for probable primality. Often such tests do not rely on fixed parameters , but rather select them in a certain way depending on the input number n in order to decrease the proportion of false positives, i.e., composite numbers that pass the test. Sometimes such composite numbers are commonly called Frobenius pseudoprimes, although they may correspond to different parameters.
Using parameter selection ideas first laid out in Baillie and Wagstaff (1980) as part of the Baillie–PSW primality test and used by Grantham in his quadratic Frobenius test, one can create even better quadratic tests. In particular, it was shown that choosing parameters from quadratic non-residues modulo n (based on the Jacobi symbol) makes far stronger tests, and is one reason for the success of the Baillie–PSW primality test. For instance, for the parameters (P,2), where P is the first odd integer that satisfies , there are no pseudoprimes below .
Yet another test is proposed by Khashin. For a given non-square number n, it first computes a parameter c as the smallest odd prime having Jacobi symbol , and then verifies the congruence:
While all prime n pass this test, a composite n passes it if and only if n is a Frobenius pseudoprime for . Similar to the above example, Khashin notes that no pseudoprime has been found for his test. He further shows that any that exist under 260 must have a factor less than 19 or have c > 128.
The computational cost of the Frobenius pseudoprimality test with respect to quadratic polynomials is roughly three times the cost of a strong pseudoprimality test (e.g. a single round of the Miller–Rabin primality test), 1.5 times that of a Lucas pseudoprimality test, and slightly more than a Baillie–PSW primality test.
Note that the quadratic Frobenius test is stronger than the Lucas test. For example, 1763 is a Lucas pseudoprime to (P, Q) = (3, -1) since U1764(3,-1) ≡ 0 (mod 1763) (U(3,-1) is given in OEIS: A006190), and it also passes the Jacobi step since , but it fails the Frobenius test to x2 - 3x - 1. This property can be clearly seen when the algorithm is formulated as shown in Crandall and Pomerance Algorithm 3.6.9 or as shown by Loebenberger, as the algorithm does a Lucas test followed by an additional check for the Frobenius condition.
While the quadratic Frobenius test does not have formal error bounds beyond that of the Lucas test, it can be used as the basis for methods with much smaller error bounds. Note that these have more steps, additional requirements, and non-negligible additional computation beyond what is described on this page. It is important to note that the error bounds for these methods do not apply to the standard or strong Frobenius tests with fixed values of (P,Q) described on this page.
Based on this idea of pseudoprimes, algorithms with strong worst-case error bounds can be built. The quadratic Frobenius test, using a quadratic Frobenius test plus other conditions, has a bound of . Müller in 2001 proposed the MQFT test with bounds of essentially . Damgård and Frandsen in 2003 proposed the EQFT with a bound of essentially . Seysen in 2005 proposed the SQFT test with a bound of and a SQFT3 test with a bound of . 
Given the same computational effort, these offer better worst-case bounds than the commonly used Miller–Rabin primality test.