<s>
Trial	B-Algorithm
division	I-Algorithm
is	O
the	O
most	O
laborious	O
but	O
easiest	O
to	O
understand	O
of	O
the	O
integer	O
factorization	O
algorithms	O
.	O
</s>
<s>
The	O
essential	O
idea	O
behind	O
trial	B-Algorithm
division	I-Algorithm
tests	O
to	O
see	O
if	O
an	O
integer	O
n	O
,	O
the	O
integer	O
to	O
be	O
factored	O
,	O
can	O
be	O
divided	O
by	O
each	O
number	O
in	O
turn	O
that	O
is	O
less	O
than	O
n	O
.	O
For	O
example	O
,	O
for	O
the	O
integer	O
,	O
the	O
only	O
numbers	O
that	O
divide	O
it	O
are	O
1	O
,	O
2	O
,	O
3	O
,	O
4	O
,	O
6	O
,	O
12	O
.	O
</s>
<s>
Trial	B-Algorithm
division	I-Algorithm
was	O
first	O
described	O
by	O
Fibonacci	O
in	O
his	O
book	O
Liber	O
Abaci	O
(	O
1202	O
)	O
.	O
</s>
<s>
Given	O
an	O
integer	O
n	O
(	O
n	O
refers	O
to	O
"	O
the	O
integer	O
to	O
be	O
factored	O
"	O
)	O
,	O
the	O
trial	B-Algorithm
division	I-Algorithm
consists	O
of	O
systematically	O
testing	O
whether	O
n	O
is	O
divisible	O
by	O
any	O
smaller	O
number	O
.	O
</s>
<s>
An	O
example	O
of	O
the	O
trial	B-Algorithm
division	I-Algorithm
algorithm	O
,	O
using	O
successive	O
integers	O
as	O
trial	O
factors	O
,	O
is	O
as	O
follows	O
(	O
in	O
Python	O
)	O
:	O
</s>
<s>
These	O
versions	O
of	O
trial	B-Algorithm
division	I-Algorithm
are	O
guaranteed	O
to	O
find	O
a	O
factor	O
of	O
n	O
if	O
there	O
is	O
one	O
since	O
they	O
check	O
all	O
possible	O
factors	O
of	O
n	O
and	O
if	O
n	O
is	O
a	O
prime	O
number	O
,	O
this	O
means	O
trial	O
factors	O
all	O
the	O
way	O
up	O
to	O
n	O
.	O
Thus	O
,	O
if	O
the	O
algorithm	O
finds	O
one	O
factor	O
only	O
,	O
n	O
,	O
it	O
is	O
proof	O
that	O
n	O
is	O
a	O
prime	O
.	O
</s>
<s>
In	O
the	O
worst	B-General_Concept
case	I-General_Concept
,	O
trial	B-Algorithm
division	I-Algorithm
is	O
a	O
laborious	O
algorithm	O
.	O
</s>
<s>
trial	B-Algorithm
divisions	I-Algorithm
,	O
where	O
denotes	O
the	O
prime-counting	O
function	O
,	O
the	O
number	O
of	O
primes	O
less	O
than	O
x	O
.	O
</s>
<s>
This	O
does	O
not	O
take	O
into	O
account	O
the	O
overhead	O
of	O
primality	B-Algorithm
testing	I-Algorithm
to	O
obtain	O
the	O
prime	O
numbers	O
as	O
candidate	O
factors	O
.	O
</s>
<s>
Preparing	O
such	O
a	O
table	O
(	O
usually	O
via	O
the	B-Algorithm
Sieve	I-Algorithm
of	I-Algorithm
Eratosthenes	I-Algorithm
)	O
would	O
only	O
be	O
worthwhile	O
if	O
many	O
numbers	O
were	O
to	O
be	O
tested	O
.	O
</s>
<s>
If	O
instead	O
a	O
variant	O
is	O
used	O
without	O
primality	B-Algorithm
testing	I-Algorithm
,	O
but	O
simply	O
dividing	O
by	O
every	O
odd	O
number	O
less	O
than	O
the	O
square	O
root	O
the	O
base-2	O
n	O
digit	O
number	O
a	O
,	O
prime	O
or	O
not	O
,	O
it	O
can	O
take	O
up	O
to	O
about	O
:	O
</s>
<s>
However	O
,	O
many-digit	O
numbers	O
that	O
do	O
not	O
have	O
factors	O
in	O
the	O
small	O
primes	O
can	O
require	O
days	O
or	O
months	O
to	O
factor	O
with	O
the	O
trial	B-Algorithm
division	I-Algorithm
.	O
</s>
<s>
In	O
such	O
cases	O
other	O
methods	O
are	O
used	O
such	O
as	O
the	O
quadratic	B-Algorithm
sieve	I-Algorithm
and	O
the	O
general	B-Algorithm
number	I-Algorithm
field	I-Algorithm
sieve	I-Algorithm
(	O
GNFS	B-Algorithm
)	O
.	O
</s>
<s>
For	O
this	O
reason	O
,	O
in	O
public	B-Application
key	I-Application
cryptography	I-Application
,	O
values	O
for	O
a	O
are	O
chosen	O
to	O
have	O
large	O
prime	O
factors	O
of	O
similar	O
size	O
so	O
that	O
they	O
cannot	O
be	O
factored	O
by	O
any	O
publicly	O
known	O
method	O
in	O
a	O
useful	O
time	O
period	O
on	O
any	O
available	O
computer	O
system	O
or	O
computer	O
cluster	O
such	O
as	O
supercomputers	B-Architecture
and	O
computer	B-Architecture
grids	I-Architecture
.	O
</s>
<s>
The	O
largest	O
cryptography-grade	O
number	O
that	O
has	O
been	O
factored	O
is	O
RSA-250	O
,	O
a	O
250	O
digits	O
number	O
,	O
using	O
the	O
GNFS	B-Algorithm
and	O
resources	O
of	O
several	O
supercomputers	B-Architecture
.	O
</s>
