Background
Multiplicative congruential generators (MCGs) and
linear congruential generators (LCGs) are a common algorithm for
implementing a pseudo-random random number generator (PRNG).
They take the form of:
xn = axn−1 (mod m) (MCG)
xn = axn−1 + c (mod m) (LCG),
where x is the sequence of outputs (x0 is the so-called seed
,
which I assume is a term you are familiar with),
a is the multiplier,
c is the increment and m is the modulus.
In 1999, Pierre L’Ecuyer presented a paper entitled
Tables of Linear Congruential Generators of Different Sizes and Good Lattice
Structure
that was published in volume 68(225) of
Mathematics of Computation, pp. 249–260
(doi:10.1090/S0025-5718-99-00996-5).
However, there have been significant errata
affecting the most useful part,
the tables of good MCG and LCG parameters.
Neither are PDFs particularly accessible
nor are errata obvious to find,
so I will be summarizing the parts relevant for those
who just want a working MCG or LCG.
There are two major kinds of generators that L’Ecuyer looked at: Those with prime m and those with m as a power of two. With prime m, no increment c is necessary. However, with m being a power of two—and for performance reasons this is often interesting—, the maximum period with no increment can be achieved with a = 5 (mod 8) for a period of m/4; by adding an (odd) increment c, you can get the full period of m. However, in any case, with an LCG with a modulus that is a power of two, you must use only the upper bits as the lower bits have a small period. Additionally, if using no increment, the seed must be odd with a power of two. In summary:
- m is prime
- no increment; difficult to make uniform random numbers out of
- m is a power of two and using no increment
- toss lower bits, ideally at least 32;
seed must be odd - m is a power of two and using increment
- toss lower bits, ideally at least 32;
increment must be odd
For implementation reasons, only Mersenne primes and pseudo-Mersenne primes (2e − f, where f is very small [pseudo-Mersenne prime] or f = 1 [Mersenne prime]) are considered for prime moduli. Details on how to implement this are widely available.
I do not recommend using an LCG or MCG and instead suggest, wherever possible, the use of the xo(ro)shiro family or LXM generators. But practical necessity sometimes makes an LCG or MCG unavoidable.
Historical note: Guy L. Steele Jr. and Sebastino Vigna have presented
a different set of multipliers and performed an exhaustive search for all numbers up to 35 bits
in their paper Computationally easy, spectrally good multipliers for congruential pseudorandom number generators
,
published in volume 52(2) of Journal of: Software: Practice and Experience, pp. 443–458
(doi:10.1002/spe.3030).
These seem preferable over L’Ecuyer’s multipliers as they could benefit from modern computational power
to explore the search space.
However, my post only provides the parameters in L’Ecuyer’s paper because the errata are numerous and
significant,
so using them without a consolidated list is inconvenient.
Tables incorporating the errata
In these tables, the M value roughly means whether the multipliers that are good for small, medium and large dimensions. The best M value in a class is emphasized. You generally want the one with the best for M32.
The a* value is the multiplicative inverse of a and generates the same sequence, just in reverse.
Table for prime m
Use xn = axn−1 (mod m).
Data also available as comma-separated values (CSV).
m | a | a* | M8 | M16 | M32 |
---|---|---|---|---|---|
28 − 5 | 33 | 213 | 0.70617 | 0.66083 | 0.64645 |
55 | 178 | 0.66973 | 0.66973 | 0.64645 | |
29 − 3 | 35 | 160 | 0.68202 | 0.68202 | 0.63233 |
110 | 236 | 0.68202 | 0.68202 | 0.63233 | |
273 | 399 | 0.68202 | 0.68202 | 0.63233 | |
349 | 474 | 0.68202 | 0.68202 | 0.63233 | |
210 − 3 | 65 | 377 | 0.69069 | 0.66317 | 0.61872 |
644 | 956 | 0.69069 | 0.66317 | 0.61872 | |
211 − 9 | 995 | 1498 | 0.72170 | 0.65531 | 0.60549 |
328 | 603 | 0.69551 | 0.69189 | 0.60549 | |
393 | 799 | 0.65283 | 0.65283 | 0.65283 | |
212 − 3 | 209 | 3858 | 0.67296 | 0.60649 | 0.60649 |
235 | 3884 | 0.67296 | 0.60649 | 0.60649 | |
352 | 500 | 0.64259 | 0.64259 | 0.64259 | |
3593 | 3741 | 0.64259 | 0.64259 | 0.64259 | |
213 − 1 | 884 | 7459 | 0.67317 | 0.61508 | 0.61508 |
1716 | 5580 | 0.64854 | 0.64854 | 0.64854 | |
2685 | 6083 | 0.64854 | 0.64854 | 0.64854 | |
214 − 3 | 572 | 13374 | 0.71968 | 0.59638 | 0.59638 |
3007 | 15809 | 0.71968 | 0.59638 | 0.59638 | |
665 | 3424 | 0.71116 | 0.66792 | 0.65508 | |
12957 | 15716 | 0.71116 | 0.66792 | 0.65508 | |
215 − 19 | 219 | 30805 | 0.71802 | 0.56955 | 0.56955 |
1944 | 32530 | 0.71802 | 0.56955 | 0.56955 | |
9515 | 10088 | 0.69372 | 0.67356 | 0.67356 | |
22661 | 23234 | 0.69372 | 0.67356 | 0.67356 | |
216 − 15 | 17364 | 32236 | 0.70713 | 0.44566 | 0.44566 |
33285 | 48157 | 0.70713 | 0.44566 | 0.44566 | |
2469 | 47104 | 0.64650 | 0.63900 | 0.63900 | |
217 − 1 | 43165 | 66284 | 0.70941 | 0.58409 | 0.58409 |
29223 | 119858 | 0.67169 | 0.67169 | 0.65617 | |
29803 | 76704 | 0.66838 | 0.66230 | 0.66230 | |
218 − 5 | 92717 | 166972 | 0.72539 | 0.61601 | 0.61601 |
21876 | 118068 | 0.67832 | 0.67832 | 0.67019 | |
219 − 1 | 283741 | 358899 | 0.72130 | 0.59188 | 0.59188 |
37698 | 127574 | 0.66780 | 0.66780 | 0.65255 | |
155411 | 157781 | 0.69573 | 0.66646 | 0.66646 | |
220 − 3 | 380985 | 444362 | 0.71709 | 0.60387 | 0.60387 |
604211 | 667588 | 0.71709 | 0.60387 | 0.60387 | |
100768 | 463964 | 0.66055 | 0.66055 | 0.60062 | |
947805 | 584609 | 0.66055 | 0.66055 | 0.60062 | |
22202 | 246298 | 0.66738 | 0.65888 | 0.65888 | |
1026371 | 802275 | 0.66738 | 0.65888 | 0.65888 | |
221 − 9 | 360889 | 1372180 | 0.72537 | 0.59108 | 0.59108 |
1043187 | 1352851 | 0.68608 | 0.68608 | 0.62381 | |
1939807 | 1969917 | 0.68492 | 0.68492 | 0.67664 | |
222 − 3 | 914334 | 1406151 | 0.72226 | 0.53547 | 0.53547 |
2788150 | 3279967 | 0.72226 | 0.53547 | 0.53547 | |
1731287 | 2040406 | 0.67819 | 0.67819 | 0.67611 | |
2463014 | 2153895 | 0.67819 | 0.67819 | 0.67611 | |
223 − 15 | 653276 | 5169235 | 0.73407 | 0.65758 | 0.61581 |
3219358 | 7735317 | 0.73407 | 0.65758 | 0.61581 | |
1706325 | 6513898 | 0.67462 | 0.67462 | 0.65778 | |
6682268 | 1874695 | 0.67462 | 0.67462 | 0.65778 | |
422527 | 5515073 | 0.67530 | 0.66916 | 0.66916 | |
7966066 | 2873520 | 0.67530 | 0.66916 | 0.66916 | |
224 − 3 | 6423135 | 9726917 | 0.74477 | 0.54337 | 0.54337 |
7050296 | 10354078 | 0.74477 | 0.54337 | 0.54337 | |
4408741 | 6180188 | 0.66849 | 0.66849 | 0.66543 | |
12368472 | 10597025 | 0.66849 | 0.66849 | 0.66543 | |
931724 | 5637643 | 0.68149 | 0.66735 | 0.66735 | |
15845489 | 11139570 | 0.68149 | 0.66735 | 0.66735 | |
225 − 39 | 25907312 | 32544832 | 0.74982 | 0.58170 | 0.58170 |
12836191 | 5420585 | 0.69488 | 0.68447 | 0.57247 | |
28133808 | 20718202 | 0.69488 | 0.68447 | 0.57247 | |
25612572 | 1860625 | 0.67766 | 0.67105 | 0.66953 | |
31693768 | 7941821 | 0.67766 | 0.67105 | 0.66953 | |
226 − 5 | 26590841 | 11526618 | 0.76610 | 0.55995 | 0.55995 |
19552116 | 24409594 | 0.69099 | 0.69099 | 0.64966 | |
66117721 | 6763103 | 0.68061 | 0.67408 | 0.67062 | |
227 − 39 | 45576512 | 70391260 | 0.75874 | 0.58717 | 0.58717 |
63826429 | 88641177 | 0.75874 | 0.58717 | 0.58717 | |
3162696 | 71543207 | 0.70233 | 0.67264 | 0.66714 | |
228 − 57 | 24604978 |
15087383 |
0.74215 | 0.52820 | 0.52820 |
14085322 |
10244594 |
0.70462 | 0.67353 | 0.56023 | |
29908911 | 16644184 |
0.67604 | 0.67353 | 0.58183 | |
10412289 |
11150150 |
0.66326 | 0.65808 | 0.65808 | |
229 − 3 | 52033280 |
21911818 |
0.75238 | 0.59538 | 0.59538 |
53087717 |
47590529 |
0.67352 | 0.67088 | 0.66418 | |
230 − 35 | 77164534 |
59929096 |
0.74881 | 0.60540 | 0.59895 |
29539716 |
10175869 |
0.68323 | 0.67420 | 0.52102 | |
92174606 |
67918656 |
0.65830 | 0.65830 | 0.65830 | |
231 − 1 | 15834580 |
11324897 |
0.72771 | 0.61996 | 0.61996 |
78458871 |
16349061 |
0.65885 | 0.65388 | 0.65388 | |
232 − 5 | 15886356 |
38707093 |
0.74530 | 0.64199 | 0.64034 |
12231068 |
42238796 |
0.69299 | 0.67551 | 0.64034 | |
27947027 |
18159766 |
0.65862 | 0.65862 | 0.65862 | |
233 − 9 | 74251943 |
84367678 |
0.73666 | 0.45155 | 0.45155 |
22784426 |
17295160 |
0.66244 | 0.65958 | 0.63549 | |
73126386 |
20527721 |
0.65221 | 0.65221 | 0.65221 | |
234 − 41 | 52955177 |
24471570 |
0.73607 | 0.42784 | 0.42784 |
47318637 |
66252955 |
0.66652 | 0.66652 | 0.65074 | |
235 − 31 | 31241991 |
27181987 |
0.74740 | 0.55117 | 0.55117 |
22277574 |
16353251 |
0.68241 | 0.65471 | 0.61272 | |
80948719 |
31023073 |
0.64471 | 0.64471 | 0.64471 | |
236 − 5 | 49865143 |
44525253 |
0.72011 | 0.56045 | 0.56045 |
45453986 |
40162435 |
0.66038 | 0.65905 | 0.65665 | |
237 − 25 | 76886758 |
31450092 |
0.73284 | 0.59222 | 0.55865 |
29967358 |
10563843 |
0.70849 | 0.65341 | 0.63328 | |
85876534 |
11689588 |
0.66073 | 0.65085 | 0.65085 | |
238 − 45 | 17838542 |
23458490 |
0.72311 | 0.59289 | 0.57131 |
10126235 |
25882453 |
0.65223 | 0.65035 | 0.60629 | |
24271817 |
14108653 |
0.64022 | 0.64022 | 0.63644 | |
239 − 7 | 61992693 |
20738293 |
0.72606 | 0.50283 | 0.50283 |
48658334 |
24705879 |
0.65522 | 0.64233 | 0.62267 | |
54124073 |
68317042 |
0.64118 | 0.64118 | 0.64118 | |
240 − 87 | 10389148 |
95656941 |
0.73656 | 0.56206 | 0.56206 |
88718554 |
86434114 |
0.68083 | 0.67629 | 0.60506 | |
93733335 |
94546721 |
0.69567 | 0.64693 | 0.64286 | |
241 − 21 | 14024511 |
18881165 |
0.72891 | 0.57568 | 0.57568 |
41648002 |
14208146 |
0.65093 | 0.64692 | 0.61035 | |
13197433 |
71794317 |
0.65422 | 0.63748 | 0.63748 | |
242 − 11 | 22148135 |
43659464 |
0.74418 | 0.62178 | 0.62178 |
29286036 |
30156309 |
0.66427 | 0.66427 | 0.62145 | |
92644101 |
62603185 |
0.66812 | 0.65172 | 0.64110 | |
243 − 57 | 49280523 |
45417637 |
0.73258 | 0.58054 | 0.58054 |
42049261 |
34341054 |
0.67015 | 0.65195 | 0.62862 | |
36634555 |
23997679 |
0.65062 | 0.63552 | 0.63552 | |
244 − 17 | 63076172 |
12680217 |
0.72095 | 0.40161 | 0.40161 |
11394954 |
63632818 |
0.64726 | 0.64726 | 0.61755 | |
94930580 |
12442836 |
0.64034 | 0.63577 | 0.63577 | |
245 − 55 | 25933916 |
36089037 |
0.74020 | 0.48371 | 0.48371 |
18586042 |
11850386 |
0.66812 | 0.65288 | 0.57775 | |
20827157 |
58703572 |
0.65174 | 0.63771 | 0.63771 | |
246 − 21 | 63975993 |
63448138 |
0.74158 | 0.59455 | 0.59455 |
15721062 |
56602273 |
0.65292 | 0.65292 | 0.56919 | |
31895852 |
30001556 |
0.65853 | 0.64391 | 0.63482 | |
247 − 115 | 72624924 |
90086464 |
0.73939 | 0.61202 | 0.58428 |
47912952 |
65482710 |
0.66046 | 0.66046 | 0.57075 | |
10609005 |
11506732 |
0.63210 | 0.63210 | 0.63210 | |
248 − 59 | 49235258 |
25308734 |
0.74586 | 0.42596 | 0.42596 |
51699608 |
84191509 |
0.66302 | 0.64985 | 0.58435 | |
59279420 |
16372480 |
0.65839 | 0.63595 | 0.63595 | |
249 − 81 | 26560988 |
46313425 |
0.73506 | 0.53066 | 0.53066 |
48056761 |
54511640 |
0.65594 | 0.64246 | 0.57269 | |
30589885 |
19096592 |
0.66333 | 0.63788 | 0.63577 | |
250 − 27 | 10871413 |
10511220 |
0.72852 | 0.52208 | 0.52208 |
15725272 |
42270599 |
0.63912 | 0.63912 | 0.62044 | |
79103836 |
60598529 |
0.64466 | 0.62837 | 0.62837 | |
251 − 129 | 34904419 |
21288849 |
0.73054 | 0.53683 | 0.53683 |
27767857 |
59826967 |
0.65501 | 0.64283 | 0.61820 | |
48684818 |
19801137 |
0.67181 | 0.63497 | 0.63497 | |
252 − 47 | 43592879 |
37070798 |
0.72095 | 0.48117 | 0.48117 |
36226890 |
29041442 |
0.68827 | 0.64482 | 0.60841 | |
71166764 |
33193477 |
0.63766 | 0.63067 | 0.63067 | |
253 − 111 | 20828392 |
31416271 |
0.74842 | 0.49471 | 0.49471 |
41790817 |
11698314 |
0.64967 | 0.64102 | 0.59333 | |
56670725 |
79829867 |
0.67430 | 0.63503 | 0.63503 | |
254 − 33 | 91311482 |
17639054 |
0.71956 | 0.59136 | 0.59136 |
38192171 |
68225463 |
0.67456 | 0.65646 | 0.60358 | |
11676603 |
13197393 |
0.66189 | 0.63663 | 0.63250 | |
255 − 55 | 33266544 |
11719476 |
0.73046 | 0.61066 | 0.55598 |
19708881 |
32182684 |
0.65421 | 0.65091 | 0.61035 | |
32075972 |
15995561 |
0.62948 | 0.62948 | 0.62948 | |
256 − 5 | 45955516 |
61285142 |
0.72026 | 0.57724 | 0.57724 |
26093644 |
69294271 |
0.67840 | 0.66318 | 0.58207 | |
45955516 |
23899168 |
0.64778 | 0.64243 | 0.62784 | |
257 − 13 | 75953708 |
66352637 |
0.72732 | 0.57473 | 0.56026 |
95424006 |
22748123 |
0.64856 | 0.64856 | 0.59464 | |
13368647 |
11307975 |
0.64588 | 0.62957 | 0.62957 | |
258 − 27 | 10156569 |
56502943 |
0.77453 | 0.55885 | 0.55885 |
16384793 |
25646249 |
0.68047 | 0.66531 | 0.54314 | |
20663831 |
28146528 |
0.64632 | 0.63406 | 0.63406 | |
259 − 55 | 34676485 |
28751471 |
0.71819 | 0.54325 | 0.54325 |
12479588 |
52645746 |
0.64928 | 0.64760 | 0.62279 | |
57322340 |
81222304 |
0.64258 | 0.63111 | 0.63111 | |
260 − 93 | 56186077 |
79300725 |
0.72541 | 0.50786 | 0.50786 |
43913823 |
99892254 |
0.66098 | 0.65258 | 0.60350 | |
73402263 |
67273627 |
0.66024 | 0.62375 | 0.62375 | |
261 − 1 | 13517504 |
20781730 |
0.71028 | 0.54999 | 0.54276 |
10709220 |
21269464 |
0.63769 | 0.63769 | 0.56108 | |
12672050 |
12838392 |
0.63648 | 0.62092 | 0.62092 | |
262 − 57 | 27742436 |
19833737 |
0.72982 | 0.61073 | 0.59560 |
43133471 |
11597394 |
0.64966 | 0.64180 | 0.59560 | |
21926418 |
26745465 |
0.62431 | 0.62374 | 0.62374 | |
263 − 25 | 46459065 |
60091810 |
0.73855 | 0.50741 | 0.50741 |
25510913 |
90065416 |
0.65169 | 0.64418 | 0.58261 | |
43733055 |
64589281 |
0.62582 | 0.62582 | 0.62497 | |
264 − 59 | 13891176 |
90448364 |
0.74105 | 0.36297 | 0.36297 |
22270570 |
17412224 |
0.68377 | 0.64579 | 0.52405 | |
18263440 |
81146598 |
0.63276 | 0.62970 | 0.62970 | |
2127 − 1 | 82461096 |
33541844 |
0.74702 | 0.50027 | 0.50027 |
11378330 |
54975487 |
0.63462 | 0.62590 | 0.56105 | |
29590761 |
11248885 |
0.68766 | 0.62059 | 0.61214 | |
2128 − 159 | 24326737 |
27020879 |
0.74262 | 0.56865 | 0.50100 |
55401819 |
16932721 |
0.64466 | 0.64466 | 0.51726 | |
11968281 |
19780143 |
0.64289 | 0.62396 | 0.62396 |
Table for prime m and small multiplication result
Use xn = axn−1 (mod m).
This table gives parameters that ensure that the product of a multiplied by m − 1 is less than 253, allowing safe implementation with IEEE floating point numbers (e. g. JavaScript's sole number type). Values numbers of class for 227 and lower are not given as this constraint is also met by the prime m table above for all multipliers (except for a ≥ 67108883 for m = 227 − 39). No a* values are given, which would all be too great.
Data also available as comma-separated values (CSV).
m | a | M8 | M16 | M32 |
---|---|---|---|---|
228 − 57 | 31792125 | 0.75519 | 0.62442 | 0.61882 |
28932291 | 0.68564 | 0.67353 | 0.64453 | |
18225409 | 0.68003 | 0.66230 | 0.66230 | |
229 − 3 | 16538103 | 0.75238 | 0.59538 | 0.59538 |
3893367 | 0.69582 | 0.67168 | 0.62950 | |
4723776 | 0.68494 | 0.66667 | 0.66418 | |
5993731 | 0.67352 | 0.67088 | 0.66418 | |
230 − 35 | 5122456 | 0.73967 | 0.59108 | 0.59108 |
4367618 | 0.70100 | 0.67634 | 0.59583 | |
6453531 | 0.66184 | 0.65253 | 0.65253 | |
231 − 1 | 1389796 | 0.72332 | 0.58994 | 0.57735 |
950975 | 0.67392 | 0.66519 | 0.60858 | |
3467255 | 0.66306 | 0.65379 | 0.65379 | |
232 − 5 | 657618 | 0.72484 | 0.47308 | 0.47308 |
93167 | 0.65996 | 0.65996 | 0.62613 | |
1345659 | 0.65121 | 0.65121 | 0.65121 | |
233 − 9 | 340416 | 0.74831 | 0.54269 | 0.54269 |
885918 | 0.66495 | 0.66295 | 0.65151 | |
530399 | 0.67694 | 0.65619 | 0.65438 | |
234 − 41 | 102311 | 0.72236 | 0.53661 | 0.53661 |
151586 | 0.65895 | 0.65355 | 0.56180 | |
97779 | 0.67327 | 0.64581 | 0.64581 | |
235 − 31 | 200105 | 0.70888 | 0.59919 | 0.59919 |
258524 | 0.64888 | 0.64749 | 0.60094 | |
185852 | 0.65064 | 0.64725 | 0.64725 |
Table for m as a power of two and odd c
Use xn = axn−1 + c (mod m).
No a* values are given as the increment prevents the reverse sequence by just using a modular multiplicative inverse.
Data also available as comma-separated values (CSV).
m | a | M8 | M16 | M32 |
---|---|---|---|---|
230 | 43829361 |
0.75107 | 0.58300 | 0.58300 |
52359285 |
0.70068 | 0.67686 | 0.64694 | |
11664645 |
0.67718 | 0.67420 | 0.67107 | |
231 | 37769685 | 0.75896 | 0.59146 | 0.59146 |
26757677 | 0.68312 | 0.68289 | 0.60858 | |
20501397 | 0.67787 | 0.67787 | 0.66548 | |
232 | 28913364 |
0.75466 | 0.56806 | 0.56806 |
29943829 | 0.67429 | 0.67105 | 0.58062 | |
32310901 | 0.65630 | 0.65336 | 0.65336 | |
233 | 37663836 |
0.75029 | 0.56952 | 0.56952 |
32684613 | 0.68055 | 0.67255 | 0.62595 | |
50803846 |
0.66619 | 0.66604 | 0.66604 | |
234 | 52765661 | 0.74421 | 0.54539 | 0.54539 |
50004141 | 0.68442 | 0.67057 | 0.65570 | |
67037349 | 0.69761 | 0.66579 | 0.66579 | |
235 | 22475205 | 0.74676 | 0.51736 | 0.51736 |
15319397 | 0.67472 | 0.66933 | 0.60508 | |
15550228 |
0.65734 | 0.65552 | 0.65552 | |
236 | 12132445 | 0.75179 | 0.52329 | 0.51602 |
8572309 | 0.66450 | 0.66389 | 0.64445 | |
33690453 | 0.68461 | 0.65808 | 0.65760 | |
240 | 33016957 |
0.75723 | 0.46879 | 0.46879 |
42595477 | 0.67959 | 0.66436 | 0.63832 | |
33261733 | 0.65941 | 0.65477 | 0.65477 | |
248 | 18146547 |
0.75812 | 0.54668 | 0.54668 |
77596615 |
0.67653 | 0.66906 | 0.61130 | |
10430376 |
0.66530 | 0.64759 | 0.64759 | |
260 | 45433914 |
0.75956 | 0.57465 | 0.57465 |
21828622 |
0.65844 | 0.65566 | 0.63458 | |
39590465 |
0.63944 | 0.63944 | 0.63944 | |
263 | 92197414 |
0.73715 | 0.54235 | 0.54235 |
28061969 |
0.69668 | 0.66519 | 0.60754 | |
32492868 |
0.64507 | 0.63523 | 0.63523 | |
264 | 28629335 |
0.75673 | 0.55283 | 0.54445 |
32020345 |
0.66164 | 0.66041 | 0.60256 | |
39355590 |
0.67938 | 0.63763 | 0.63763 | |
296 | 75564983 |
0.74760 | 0.61011 | 0.61011 |
41898663 |
0.64460 | 0.64460 | 0.54346 | |
22104684 |
0.65329 | 0.63558 | 0.63287 | |
2128 | 47026247 |
0.74763 | 0.58508 | 0.57619 |
52583122 |
0.70223 | 0.65994 | 0.56182 | |
47026247 |
0.64332 | 0.63077 | 0.62853 |
Table for m as a power of two c = 0
Use xn = axn−1 (mod m).
Avoid these generators; see above. Either use an increment or a prime modulus instead. For completeness relating to the original paper, I still list the values here.
Data also available as comma-separated values (CSV).
m | a | a* | M8 | M16 | M32 |
---|---|---|---|---|---|
230 | 17791152 |
28580836 |
0.74878 | 0.61693 | 0.61693 |
15605186 |
85758072 |
0.69501 | 0.67940 | 0.64413 | |
14313386 |
77076766 |
0.69305 | 0.66791 | 0.66791 | |
231 | 59415689 |
98914277 |
0.75913 | 0.50735 | 0.50735 |
55817714 |
14877073 |
0.68978 | 0.68749 | 0.59450 | |
60216965 |
44889935 |
0.67295 | 0.67116 | 0.67116 | |
232 | 74110359 |
41092131 |
0.75652 | 0.60751 | 0.60751 |
15973346 |
85172396 |
0.70068 | 0.67686 | 0.64694 | |
74779640 |
34254352 |
0.66893 | 0.66001 | 0.66001 | |
233 | 21852533 |
17317055 |
0.75896 | 0.59146 | 0.59146 |
21742413 |
35544488 |
0.68312 | 0.68289 | 0.60858 | |
21679850 |
81627626 |
0.67787 | 0.67787 | 0.66548 | |
234 | 11481271 |
16579283 |
0.75466 | 0.56806 | 0.56806 |
43249111 |
14504929 |
0.67429 | 0.67105 | 0.58062 | |
43272781 |
78811038 |
0.65630 | 0.65336 | 0.65336 | |
235 | 86704420 |
10790122 |
0.75818 | 0.52727 | 0.52727 |
86226192 |
31842912 |
0.68055 | 0.67255 | 0.62595 | |
22260253 |
71130248 |
0.66619 | 0.66604 | 0.66604 | |
236 | 40928562 |
31404866 |
0.75662 | 0.50169 | 0.50169 |
17229873 |
35216319 |
0.68442 | 0.67057 | 0.65570 | |
17246906 |
12512050 |
0.69761 | 0.66579 | 0.66579 | |
248 | 49402601 |
75935939 |
0.75801 | 0.55089 | 0.55089 |
70189847 |
20977354 |
0.67618 | 0.66857 | 0.63609 | |
21749276 |
13684255 |
0.65702 | 0.64692 | 0.64692 | |
260 | 27613748 |
67285798 |
0.75277 | 0.48916 | 0.48916 |
15087899 |
11084564 |
0.65527 | 0.65510 | 0.59498 | |
27141332 |
11100860 |
0.64851 | 0.64851 | 0.64435 | |
263 | 35124019 |
37537217 |
0.74926 | 0.50092 | 0.50092 |
24448053 |
20792438 |
0.70937 | 0.66091 | 0.61403 | |
19875910 |
40079692 |
0.64490 | 0.64060 | 0.63994 | |
264 | 11817834 |
13515856 |
0.76039 | 0.42672 | 0.42672 |
76643458 |
18658112 |
0.67778 | 0.66115 | 0.54884 | |
26858216 |
64151287 |
0.65961 | 0.63932 | 0.63932 | |
2128 | 25096281 |
31085236 |
0.76598 | 0.55122 | 0.54891 |
23766634 |
67836365 |
0.65708 | 0.65708 | 0.55662 | |
92563704 |
29740724 |
0.63462 | 0.63462 | 0.63405 |