<s>
The	O
AKS	B-Algorithm
primality	I-Algorithm
test	I-Algorithm
(	O
also	O
known	O
as	O
Agrawal	B-Algorithm
–	I-Algorithm
Kayal	I-Algorithm
–	I-Algorithm
Saxena	I-Algorithm
primality	I-Algorithm
test	I-Algorithm
and	O
cyclotomic	B-Algorithm
AKS	I-Algorithm
test	I-Algorithm
)	O
is	O
a	O
deterministic	B-General_Concept
primality-proving	B-Algorithm
algorithm	O
created	O
and	O
published	O
by	O
Manindra	O
Agrawal	O
,	O
Neeraj	O
Kayal	O
,	O
and	O
Nitin	O
Saxena	O
,	O
computer	O
scientists	O
at	O
the	O
Indian	O
Institute	O
of	O
Technology	O
Kanpur	O
,	O
on	O
August	O
6	O
,	O
2002	O
,	O
in	O
an	O
article	O
titled	O
"	O
PRIMES	B-Algorithm
is	I-Algorithm
in	I-Algorithm
P	I-Algorithm
"	O
.	O
</s>
<s>
AKS	O
is	O
the	O
first	O
primality-proving	B-Algorithm
algorithm	O
to	O
be	O
simultaneously	O
general	O
,	O
polynomial-time	O
,	O
deterministic	B-General_Concept
,	O
and	O
unconditionally	O
correct	O
.	O
</s>
<s>
The	O
AKS	B-Algorithm
algorithm	I-Algorithm
can	O
be	O
used	O
to	O
verify	O
the	O
primality	O
of	O
any	O
general	O
number	O
given	O
.	O
</s>
<s>
Many	O
fast	O
primality	B-Algorithm
tests	I-Algorithm
are	O
known	O
that	O
work	O
only	O
for	O
numbers	O
with	O
certain	O
properties	O
.	O
</s>
<s>
For	O
example	O
,	O
the	O
Lucas	B-Algorithm
–	I-Algorithm
Lehmer	I-Algorithm
test	I-Algorithm
works	O
only	O
for	O
Mersenne	O
numbers	O
,	O
while	O
Pépin	B-Algorithm
's	I-Algorithm
test	I-Algorithm
can	O
be	O
applied	O
to	O
Fermat	O
numbers	O
only	O
.	O
</s>
<s>
ECPP	B-Algorithm
and	O
APR	B-Algorithm
conclusively	O
prove	O
or	O
disprove	O
that	O
a	O
given	O
number	O
is	O
prime	O
,	O
but	O
are	O
not	O
known	O
to	O
have	O
polynomial	O
time	O
bounds	O
for	O
all	O
inputs	O
.	O
</s>
<s>
The	O
algorithm	O
is	O
guaranteed	O
to	O
distinguish	O
deterministically	B-General_Concept
whether	O
the	O
target	O
number	O
is	O
prime	O
or	O
composite	O
.	O
</s>
<s>
Randomized	O
tests	O
,	O
such	O
as	O
Miller	B-Algorithm
–	I-Algorithm
Rabin	I-Algorithm
and	O
Baillie	B-Algorithm
–	I-Algorithm
PSW	I-Algorithm
,	O
can	O
test	O
any	O
given	O
number	O
for	O
primality	O
in	O
polynomial	O
time	O
,	O
but	O
are	O
known	O
to	O
produce	O
only	O
a	O
probabilistic	O
result	O
.	O
</s>
<s>
In	O
contrast	O
,	O
Miller	O
's	O
version	O
of	O
the	O
Miller	B-Algorithm
–	I-Algorithm
Rabin	I-Algorithm
test	I-Algorithm
is	O
fully	O
deterministic	B-General_Concept
and	O
runs	O
in	O
polynomial	O
time	O
over	O
all	O
inputs	O
,	O
but	O
its	O
correctness	O
depends	O
on	O
the	O
truth	O
of	O
the	O
yet-unproven	O
generalized	O
Riemann	O
hypothesis	O
.	O
</s>
<s>
For	O
64-bit	O
inputs	O
,	O
the	O
Baillie	B-Algorithm
–	I-Algorithm
PSW	I-Algorithm
test	I-Algorithm
is	O
deterministic	B-General_Concept
and	O
runs	O
many	O
orders	O
of	O
magnitude	O
faster	O
.	O
</s>
<s>
For	O
larger	O
inputs	O
,	O
the	O
performance	O
of	O
the	O
(	O
also	O
unconditionally	O
correct	O
)	O
ECPP	B-Algorithm
and	O
APR	B-Algorithm
tests	I-Algorithm
is	O
far	O
superior	O
to	O
AKS	O
.	O
</s>
<s>
Additionally	O
,	O
ECPP	B-Algorithm
can	O
output	O
a	O
primality	B-Algorithm
certificate	I-Algorithm
that	O
allows	O
independent	O
and	O
rapid	O
verification	O
of	O
the	O
results	O
,	O
which	O
is	O
not	O
possible	O
with	O
the	O
AKS	B-Algorithm
algorithm	I-Algorithm
.	O
</s>
<s>
While	O
the	O
relation	O
(	O
)	O
constitutes	O
a	O
primality	B-Algorithm
test	I-Algorithm
in	O
itself	O
,	O
verifying	O
it	O
takes	O
exponential	O
time	O
:	O
the	O
brute	O
force	O
approach	O
would	O
require	O
the	O
expansion	O
of	O
the	O
polynomial	O
and	O
a	O
reduction	O
of	O
the	O
resulting	O
coefficients	O
.	O
</s>
<s>
The	O
AKS	B-Algorithm
algorithm	I-Algorithm
evaluates	O
this	O
congruence	O
for	O
a	O
large	O
set	O
of	O
values	O
,	O
whose	O
size	O
is	O
polynomial	O
to	O
the	O
digits	O
of	O
.	O
</s>
<s>
The	O
proof	O
of	O
validity	O
of	O
the	O
AKS	B-Algorithm
algorithm	I-Algorithm
shows	O
that	O
one	O
can	O
find	O
an	O
and	O
a	O
set	O
of	O
values	O
with	O
the	O
above	O
properties	O
such	O
that	O
if	O
the	O
congruences	O
hold	O
then	O
is	O
a	O
power	O
of	O
a	O
prime	O
.	O
</s>
<s>
Owing	O
to	O
the	O
existence	O
of	O
the	O
many	O
variants	O
,	O
Crandall	O
and	O
Papadopoulos	O
refer	O
to	O
the	O
"	O
AKS-class	O
"	O
of	O
algorithms	O
in	O
their	O
scientific	O
paper	O
"	O
On	O
the	O
implementation	O
of	O
AKS-class	O
primality	B-Algorithm
tests	I-Algorithm
"	O
,	O
published	O
in	O
March	O
2003	O
.	O
</s>
<s>
In	O
response	O
to	O
some	O
of	O
these	O
variants	O
,	O
and	O
to	O
other	O
feedback	O
,	O
the	O
paper	O
"	O
PRIMES	B-Algorithm
is	I-Algorithm
in	I-Algorithm
P	I-Algorithm
"	O
was	O
updated	O
with	O
a	O
new	O
formulation	O
of	O
the	O
AKS	B-Algorithm
algorithm	I-Algorithm
and	O
of	O
its	O
proof	O
of	O
correctness	O
.	O
</s>
