In
arithmetic
Arithmetic () is an elementary part of mathematics that consists of the study of the properties of the traditional operations on numbers— addition, subtraction, multiplication, division, exponentiation, and extraction of roots. In the 19th ...
, an
odd composite integer ''n'' is called an Euler pseudoprime to base ''a'', if ''a'' and ''n'' are
coprime, and
:
(where ''mod'' refers to the
modulo
In computing, the modulo operation returns the remainder or signed remainder of a division, after one number is divided by another (called the '' modulus'' of the operation).
Given two positive numbers and , modulo (often abbreviated as ) is t ...
operation).
The motivation for this definition is the fact that all
prime numbers ''p'' satisfy the above equation which can be deduced from
Fermat's little theorem
Fermat's little theorem states that if ''p'' is a prime number, then for any integer ''a'', the number a^p - a is an integer multiple of ''p''. In the notation of modular arithmetic, this is expressed as
: a^p \equiv a \pmod p.
For example, if = ...
. 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 is also a
Fermat pseudoprime. It is not possible to produce a definite test of primality based on whether a
number 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
In mathematics, Set (mathematics), set ''A'' is a subset of a set ''B'' if all Element (mathematics), elements of ''A'' are also elements of ''B''; ''B'' is then a superset of ''A''. It is possible for ''A'' and ''B'' to be equal; if they are ...
of the absolute Fermat pseudoprimes, or
Carmichael numbers, 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 Hanover ...
= 7×13×19.
Relation to Euler–Jacobi pseudoprimes
The slightly stronger condition that
:
where ''n'' is an odd composite, the
greatest common divisor of ''a'' and ''n'' equals 1, and (''a''/''n'') is the
Jacobi symbol, 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. 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
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