Misplaced Pages

Euler–Jacobi pseudoprime

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.
(Redirected from Euler-Jacobi pseudoprime) Odd composite number which passes the given congruence

In number theory, an odd integer n is called an Euler–Jacobi probable prime (or, more commonly, an Euler probable prime) to base a, if a and n are coprime, and

a ( n 1 ) / 2 ( a n ) ( mod n ) {\displaystyle a^{(n-1)/2}\equiv \left({\frac {a}{n}}\right){\pmod {n}}}

where ( a n ) {\displaystyle \left({\frac {a}{n}}\right)} is the Jacobi symbol. The Jacobi symbol evaluates to 0 if a and n are not coprime, so the test can alternatively be expressed as:

a ( n 1 ) / 2 ( a n ) 0 ( mod n ) . {\displaystyle a^{(n-1)/2}\equiv \left({\frac {a}{n}}\right)\neq 0{\pmod {n}}.}

If n is an odd composite integer that satisfies the above congruence, then n is called an Euler–Jacobi pseudoprime (or, more commonly, an Euler pseudoprime) to base a.

As long as a is not a multiple of n (usually 2 ≤ a < n), then if a and n are not coprime, n is definitely composite, as 1 < gcd(a,n) < n is a factor of n.

Properties

The motivation for this definition is the fact that all prime numbers n satisfy the above equation, as explained in the Euler's criterion article. The equation can be tested rather quickly, which can be used for probabilistic primality testing. These tests are over twice as strong as tests based on Fermat's little theorem.

Every Euler–Jacobi pseudoprime is also a Fermat pseudoprime and an Euler pseudoprime. There are no numbers which are Euler–Jacobi pseudoprimes to all bases as Carmichael numbers are. Solovay and Strassen showed that for every composite n, for at least n/2 bases less than n, n is not an Euler–Jacobi pseudoprime.

The smallest Euler–Jacobi pseudoprime base 2 is 561. There are 11347 Euler–Jacobi pseudoprimes base 2 that are less than 25·10 (see OEISA047713) (page 1005 of ).

In the literature (for example,), an Euler–Jacobi pseudoprime as defined above is often called simply an Euler pseudoprime.

Implementation in Lua

function EulerJacobiTest(k)
        a = 2
        if k == 1 then return false
        elseif k == 2 then return true
        else
                if(modPow(a,(k-1)/2,k) == Jacobi(a,k)) then
                        return true
                else
                        return false
                end
        end
end

See also

References

  1. Solovay, R.; Strassen, V. (1977-03-01). "A Fast Monte-Carlo Test for Primality". SIAM Journal on Computing. 6 (1): 84–85. doi:10.1137/0206006. ISSN 0097-5397.
  2. ^ Carl Pomerance; John L. Selfridge; Samuel S. Wagstaff, Jr. (July 1980). "The pseudoprimes to 25·10" (PDF). Mathematics of Computation. 35 (151): 1003–1026. doi:10.1090/S0025-5718-1980-0572872-7. Archived (PDF) from the original on 2005-03-04.
Classes of natural numbers
Powers and related numbers
Of the form a × 2 ± 1
Other polynomial numbers
Recursively defined numbers
Possessing a specific set of other numbers
Expressible via specific sums
Figurate numbers
2-dimensional
centered
non-centered
3-dimensional
centered
non-centered
pyramidal
4-dimensional
non-centered
Combinatorial numbers
Primes
Pseudoprimes
Arithmetic functions and dynamics
Divisor functions
Prime omega functions
Euler's totient function
Aliquot sequences
Primorial
Other prime factor or divisor related numbers
Numeral system-dependent numbers
Arithmetic functions
and dynamics
Digit sum
Digit product
Coding-related
Other
P-adic numbers-related
Digit-composition related
Digit-permutation related
Divisor-related
Other
Binary numbers
Generated via a sieve
Sorting related
Natural language related
Graphemics related
Category: