<s>
Other	O
names	O
are	O
multiplicative	O
linear	B-Algorithm
congruential	I-Algorithm
generator	I-Algorithm
(	O
MLCG	O
)	O
and	O
multiplicative	B-Algorithm
congruential	I-Algorithm
generator	I-Algorithm
(	O
MCG	O
)	O
.	O
</s>
<s>
In	O
1988	O
,	O
Park	O
and	O
Miller	O
suggested	O
a	O
Lehmer	B-Algorithm
RNG	I-Algorithm
with	O
particular	O
parameters	O
m	O
=	O
2	O
−	O
1	O
=	O
2,147,483,647	O
(	O
a	O
Mersenne	O
prime	O
M	O
)	O
and	O
a	O
=	O
7	O
=	O
16,807	O
(	O
a	O
primitive	O
root	O
modulo	O
M	O
)	O
,	O
now	O
known	O
as	O
MINSTD	O
.	O
</s>
<s>
Although	O
MINSTD	O
was	O
later	O
criticized	O
by	O
Marsaglia	O
and	O
Sullivan	O
(	O
1993	O
)	O
,	O
it	O
is	O
still	O
in	O
use	O
today	O
(	O
in	O
particular	O
,	O
in	O
CarbonLib	B-Operating_System
and	O
11	O
's	O
minstd_rand0	O
)	O
.	O
</s>
<s>
This	O
revised	O
constant	O
is	O
used	O
in	O
11	O
's	O
minstd_rand	O
random	O
number	O
generator	O
.	O
</s>
<s>
The	O
Sinclair	O
ZX81	O
and	O
its	O
successors	O
use	O
the	O
Lehmer	B-Algorithm
RNG	I-Algorithm
with	O
parameters	O
m	O
=	O
2+1	O
=	O
65,537	O
(	O
a	O
Fermat	O
prime	O
F	O
)	O
and	O
a	O
=	O
75	O
(	O
a	O
primitive	O
root	O
modulo	O
F	O
)	O
.	O
</s>
<s>
The	O
CRAY	O
random	O
number	O
generator	O
RANF	O
is	O
a	O
Lehmer	B-Algorithm
RNG	I-Algorithm
with	O
the	O
power-of-two	O
modulus	O
m	O
=	O
2	O
and	O
a	O
=	O
44,485,709,377,909	O
.	O
</s>
<s>
The	O
GNU	B-Application
Scientific	I-Application
Library	I-Application
includes	O
several	O
random	O
number	O
generators	O
of	O
the	O
Lehmer	O
form	O
,	O
including	O
MINSTD	O
,	O
RANF	O
,	O
and	O
the	O
infamous	O
IBM	O
random	O
number	O
generator	O
RANDU	B-Algorithm
.	O
</s>
<s>
A	O
more	O
popular	O
implementation	O
for	O
large	O
periods	O
is	O
a	O
combined	B-Algorithm
linear	I-Algorithm
congruential	I-Algorithm
generator	I-Algorithm
;	O
combining	O
(	O
e.g.	O
</s>
<s>
One	O
example	O
of	O
this	O
is	O
the	O
Wichmann	B-Algorithm
–	I-Algorithm
Hill	I-Algorithm
generator	O
.	O
</s>
<s>
While	O
the	O
Lehmer	B-Algorithm
RNG	I-Algorithm
can	O
be	O
viewed	O
as	O
a	O
particular	O
case	O
of	O
the	O
linear	B-Algorithm
congruential	I-Algorithm
generator	I-Algorithm
with	O
,	O
it	O
is	O
a	O
special	O
case	O
that	O
implies	O
certain	O
restrictions	O
and	O
properties	O
.	O
</s>
<s>
In	O
particular	O
,	O
for	O
the	O
Lehmer	B-Algorithm
RNG	I-Algorithm
,	O
the	O
initial	O
seed	O
X	O
must	O
be	O
coprime	O
to	O
the	O
modulus	O
m	O
,	O
which	O
is	O
not	O
required	O
for	O
LCGs	B-Algorithm
in	O
general	O
.	O
</s>
<s>
The	O
choice	O
of	O
the	O
modulus	O
m	O
and	O
the	O
multiplier	O
a	O
is	O
also	O
more	O
restrictive	O
for	O
the	O
Lehmer	B-Algorithm
RNG	I-Algorithm
.	O
</s>
<s>
In	O
contrast	O
to	O
LCG	B-Algorithm
,	O
the	O
maximum	O
period	O
of	O
the	O
Lehmer	B-Algorithm
RNG	I-Algorithm
equals	O
m−1	O
,	O
and	O
it	O
is	O
such	O
when	O
m	O
is	O
prime	O
and	O
a	O
is	O
a	O
primitive	O
root	O
modulo	O
m	O
.	O
</s>
<s>
Not	O
only	O
is	O
multiplication	O
by	O
d	O
trivial	O
,	O
but	O
the	O
conditional	B-Language
subtraction	O
can	O
be	O
replaced	O
by	O
an	O
unconditional	O
shift	O
and	O
addition	O
.	O
</s>
<s>
If	O
d1	O
,	O
conditional	B-Language
subtraction	O
can	O
also	O
be	O
avoided	O
,	O
but	O
the	O
procedure	O
is	O
more	O
intricate	O
.	O
</s>
<s>
(	O
For	O
the	O
case	O
of	O
a	O
Lehmer	B-Algorithm
generator	I-Algorithm
specifically	O
,	O
a	O
zero	O
state	O
or	O
its	O
image	O
y	O
=	O
m	O
will	O
never	O
occur	O
,	O
so	O
an	O
offset	O
of	O
d−1	O
will	O
work	O
just	O
the	O
same	O
,	O
if	O
that	O
is	O
more	O
convenient	O
.	O
</s>
<s>
While	O
this	O
technique	O
is	O
popular	O
for	O
portable	O
implementations	O
in	O
high-level	B-Language
languages	I-Language
which	O
lack	O
double-width	O
operations	O
,	O
on	O
modern	O
computers	O
division	O
by	O
a	O
constant	O
is	O
usually	O
implemented	O
using	O
double-width	O
multiplication	O
,	O
so	O
this	O
technique	O
should	O
be	O
avoided	O
if	O
efficiency	O
is	O
a	O
concern	O
.	O
</s>
<s>
Even	O
in	O
high-level	B-Language
languages	I-Language
,	O
if	O
the	O
multiplier	O
a	O
is	O
limited	O
to	O
,	O
then	O
the	O
double-width	O
product	O
ax	O
can	O
be	O
computed	O
using	O
two	O
single-width	O
multiplications	O
,	O
and	O
reduced	O
using	O
the	O
techniques	O
described	O
above	O
.	O
</s>
<s>
If	O
a	O
is	O
chosen	O
so	O
that	O
r≤q	O
(	O
and	O
thus	O
r/q	O
≤1	O
)	O
,	O
then	O
the	O
second	O
term	O
is	O
also	O
less	O
than	O
m	O
:	O
r	O
≤	O
rx/q	O
=	O
x( 	O
r/q	O
)	O
≤	O
x(1 )	O
=	O
x	O
<	O
m	O
.	O
Thus	O
,	O
the	O
difference	O
lies	O
in	O
the	O
range	O
 [ 1−m , m−1 ] 	O
and	O
can	O
be	O
reduced	O
to	O
 [ 0 , m−1 ] 	O
with	O
a	O
single	O
conditional	B-Language
add	O
.	O
</s>
<s>
This	O
technique	O
may	O
be	O
extended	O
to	O
allow	O
a	O
negative	O
r	O
( −q≤r0	O
)	O
,	O
changing	O
the	O
final	O
reduction	O
to	O
a	O
conditional	B-Language
subtract	O
.	O
</s>
<s>
Using	O
C	O
code	O
,	O
the	O
Park-Miller	B-Algorithm
RNG	I-Algorithm
can	O
be	O
written	O
as	O
follows	O
:	O
</s>
<s>
Another	O
popular	O
Lehmer	B-Algorithm
generator	I-Algorithm
uses	O
the	O
prime	O
modulus	O
2−5	O
:	O
</s>
<s>
Many	O
other	O
Lehmer	B-Algorithm
generators	I-Algorithm
have	O
good	O
properties	O
.	O
</s>
<s>
The	O
following	O
modulo-2128	O
Lehmer	B-Algorithm
generator	I-Algorithm
requires	O
128-bit	O
support	O
from	O
the	O
compiler	O
and	O
uses	O
a	O
multiplier	O
computed	O
by	O
L'Ecuyer	O
.	O
</s>
<s>
This	O
generator	O
passes	O
BigCrush	O
from	O
TestU01	B-Algorithm
,	O
but	O
fails	O
the	O
TMFn	O
test	O
from	O
.	O
</s>
<s>
Linear	B-Algorithm
congruential	I-Algorithm
generators	I-Algorithm
with	O
a	O
power-of-2	O
modulus	O
have	O
a	O
similar	O
behavior	O
.	O
</s>
