Euler pseudoprime
   HOME

TheInfoList



OR:

In arithmetic, an
odd Odd means unpaired, occasional, strange or unusual, or a person who is viewed as eccentric. Odd may also refer to: Acronym * ODD (Text Encoding Initiative) ("One Document Does it all"), an abstracted literate-programming format for describing X ...
composite Composite or compositing may refer to: Materials * Composite material, a material that is made from several different substances ** Metal matrix composite, composed of metal and other parts ** Cermet, a composite of ceramic and metallic materials ...
integer An integer is the number zero (), a positive natural number (, , , etc.) or a negative integer with a minus sign ( −1, −2, −3, etc.). The negative numbers are the additive inverses of the corresponding positive numbers. In the languag ...
''n'' is called an Euler pseudoprime to base ''a'', if ''a'' and ''n'' are
coprime In mathematics, two integers and are coprime, relatively prime or mutually prime if the only positive integer that is a divisor of both of them is 1. Consequently, any prime number that divides does not divide , and vice versa. This is equivale ...
, and : a^ \equiv \pm 1\pmod (where ''mod'' refers to the modulo operation). The motivation for this definition is the fact that all
prime number A prime number (or a prime) is a natural number greater than 1 that is not a product of two smaller natural numbers. A natural number greater than 1 that is not prime is called a composite number. For example, 5 is prime because the only ways ...
s ''p'' satisfy the above equation which can be deduced from Fermat's little theorem. Fermat's theorem asserts that if ''p'' is prime, and coprime to ''a'', then ''a''''p''−1 ≡ 1 (mod ''p''). Suppose that ''p''>2 is prime, then ''p'' can be expressed as 2''q'' + 1 where ''q'' is an integer. Thus, ''a''(2''q''+1) − 1 ≡ 1 (mod ''p''), which means that ''a''2''q'' − 1 ≡ 0 (mod ''p''). This can be factored as (''a''''q'' − 1)(''a''''q'' + 1) ≡ 0 (mod ''p''), which is equivalent to ''a''(''p''−1)/2 ≡ ±1 (mod ''p''). The equation can be tested rather quickly, which can be used for probabilistic primality testing. These tests are twice as strong as tests based on Fermat's little theorem. Every Euler
pseudoprime A pseudoprime is a probable prime (an integer that shares a property common to all prime numbers) that is not actually prime. Pseudoprimes are classified according to which property of primes they satisfy. Some sources use the term pseudoprime to ...
is also a
Fermat pseudoprime In number theory, the Fermat pseudoprimes make up the most important class of pseudoprimes that come from Fermat's little theorem. Definition Fermat's little theorem states that if ''p'' is prime and ''a'' is coprime to ''p'', then ''a'p''− ...
. It is not possible to produce a definite test of primality based on whether a
number A number is a mathematical object used to count, measure, and label. The original examples are the natural numbers 1, 2, 3, 4, and so forth. Numbers can be represented in language with number words. More universally, individual numbers c ...
is an Euler pseudoprime because there exist ''absolute Euler pseudoprimes'', numbers which are Euler pseudoprimes to every base relatively prime to themselves. The absolute Euler pseudoprimes are a subset of the absolute Fermat pseudoprimes, or
Carmichael number In number theory, a Carmichael number is a composite number n, which in modular arithmetic satisfies the congruence relation: :b^n\equiv b\pmod for all integers b. The relation may also be expressed in the form: :b^\equiv 1\pmod. for all integers ...
s, and the smallest absolute Euler pseudoprime is
1729 Events January–March * January 8 – Frederick, the eldest son of King George II of Great Britain is made Prince of Wales at the age of 21, a few months after he comes to Britain for the first time after growing up in Hano ...
= 7×13×19.


Relation to Euler–Jacobi pseudoprimes

The slightly stronger condition that : a^ \equiv \left(\frac\right) \pmod n where ''n'' is an odd composite, the
greatest common divisor In mathematics, the greatest common divisor (GCD) of two or more integers, which are not all zero, is the largest positive integer that divides each of the integers. For two integers ''x'', ''y'', the greatest common divisor of ''x'' and ''y'' is ...
of ''a'' and ''n'' equals 1, and (''a''/''n'') is the
Jacobi symbol Jacobi symbol for various ''k'' (along top) and ''n'' (along left side). Only are shown, since due to rule (2) below any other ''k'' can be reduced modulo ''n''. Quadratic residues are highlighted in yellow — note that no entry with a ...
, is the more common definition of an Euler pseudoprime. See, for example, page 115 of the book by Koblitz listed below, page 90 of the book by Riesel, or page 1003 of. A discussion of numbers of this form can be found at
Euler–Jacobi pseudoprime 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^ \equiv \left(\frac\right)\pmod where \left(\frac\right) is the J ...
. There are no absolute Euler–Jacobi pseudoprimes. A strong probable prime test is even stronger than the Euler-Jacobi test but takes the same computational effort. Because of this advantage over the Euler-Jacobi test, prime-testing software is often based on the strong test.


Implementation in

Lua Lua or LUA may refer to: Science and technology * Lua (programming language) * Latvia University of Agriculture * Last universal ancestor, in evolution Ethnicity and language * Lua people, of Laos * Lawa people, of Thailand sometimes referred t ...

function EulerTest(k) a = 2 if k

1 then return false elseif k

2 then return true else if ( modPow(a,(k-1)/2,k)

1) or ( modPow(a,(k-1)/2,k)

k-1) then return true else return false end end end


Examples


Least Euler pseudoprime to base ''n''


See also

*
Probable prime In number theory, a probable prime (PRP) is an integer that satisfies a specific condition that is satisfied by all prime numbers, but which is not satisfied by most composite numbers. Different types of probable primes have different specific con ...


References

*M. Koblitz, "A Course in Number Theory and Cryptography", Springer-Verlag, 1987. *H. Riesel, "Prime numbers and computer methods of factorisation", Birkhäuser, Boston, Mass., 1985. {{DEFAULTSORT:Euler Pseudoprime Pseudoprimes