cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Previous Showing 31-40 of 70 results. Next

A382535 Consecutive states of Lehmer's original linear congruential pseudo-random number generator 23*s mod (10^8+1) when started at s=1.

Original entry on oeis.org

1, 23, 529, 12167, 279841, 6436343, 48035888, 4825413, 10984498, 52643452, 10799384, 48385830, 12874079, 96103815, 10387723, 38917627, 95105413, 87424478, 10762974, 47548400, 93613190, 53103349, 21377015, 91671341, 8440822, 94138905, 65194794, 99480248
Offset: 1

Views

Author

Sean A. Irvine, May 25 2025

Keywords

Comments

Periodic with period 5882352.
This is the first linear congruential pseudo-random number generator described in the literature. As such, it is the forerunner of one of the most widely used techniques for generating pseudo-random numbers.

Crossrefs

Cf. A009967.
Cf. A096550-A096561 (other pseudo-random number generators).

Programs

  • Mathematica
    NestList[Mod[23*#, 10^8 + 1] &, 1, 50] (* Paolo Xausa, May 26 2025 *)

Formula

a(n) = 23 * a(n-1) mod (10^8+1).

A384159 Consecutive states of the linear congruential pseudo-random number generator for 32-bit WATFOR/WATFIV when started at 1.

Original entry on oeis.org

1, 20613, 424895769, 938169853, 404929649, 1693398709, 828374025, 631292077, 1220159969, 1976439269, 430365689, 2020481117, 2026879057, 763630101, 1799615721, 1993805069, 1909315521, 1935501125, 533477081, 1446792893, 636483633, 859521397, 574460361, 126586221
Offset: 1

Views

Author

Sean A. Irvine, May 20 2025

Keywords

Comments

Periodic with period 2^29 (considerably less than the modulus).
WATFOR and WATFIV are early FORTRAN compilers from the University of Waterloo.

References

  • Terry M. Walker, Fundamentals of Fortran Programming: with WATFOR/WATFIV, Allyn and Bacon, 1975.

Crossrefs

Cf. A096550-A096561 other pseudo-random number generators.

Programs

  • Mathematica
    NestList[Mod[20613*#, 2^31] &, 1, 23] (* Stefano Spezia, May 24 2025 *)

Formula

a(n) = 20613 * a(n-1) mod 2^31.

A384217 Consecutive states of the linear congruential pseudo-random number generator (843314861*s+453816693) mod 2^31 when started at s=1.

Original entry on oeis.org

1, 1297131554, 17103983, 1426780792, 2111429773, 1142766270, 888797147, 1081516660, 1471148505, 488941338, 1429379591, 2081849904, 166513637, 1928300854, 1776832243, 142642604, 236172977, 1916812562, 182141599, 551190760, 1397538365, 1487855278, 1455317259
Offset: 1

Views

Author

Sean A. Irvine, May 29 2025

Keywords

Comments

Periodic with period 2^31 (Dyck et al. mistakenly give the period as 2^29).
Proposed by Dyck et al. for FORTRAN 77 on VAX or IBM computers.

References

  • V. A. Dyck, J. D. Lawson, and J. A. Smith, FORTRAN 77: An Introduction to Structured Problem Solving, Reston Pub. Co., 1984 (see p. 467).

Crossrefs

Cf. A096550-A096561 other pseudo-random number generators.
Cf. A384387.

Programs

  • Maple
    a:= proc(n) option remember; `if`(n<2, n,
          irem(843314861*a(n-1)+453816693, 2^31))
        end:
    seq(a(n), n=1..23);  # Alois P. Heinz, May 29 2025
  • Mathematica
    NestList[Mod[843314861*# + 453816693, 2^31] &, 1, 50] (* Paolo Xausa, May 30 2025 *)

Formula

a(n) = (843314861 * a(n-1) + 453816693) mod 2^31.

A384236 Consecutive states of the linear congruential pseudo-random number generator (9806*s+1) mod (2^17-1) when started at s=1.

Original entry on oeis.org

1, 9807, 92400, 111649, 125103, 66530, 52814, 32564, 33629, 122410, 4243, 57352, 99123, 108674, 50015, 110480, 65066, 114640, 94945, 33358, 86404, 34681, 83713, 123077, 122366, 97063, 93248, 38593, 40982, 5807, 58629, 38569, 67780, 120711, 120937, 108886
Offset: 1

Views

Author

Sean A. Irvine, May 22 2025

Keywords

Comments

Periodic with period length 2^17-2.
In the way this generator was defined by Collins, it would return values in the range [1..2^17-1] rather than the more typical [0..2^17-2] (that is, 0 would instead be 2^17-1).

References

  • William J. Collins, Intermediate Pascal Programming, McGraw-Hill, 1986 (see p. 157).

Crossrefs

Cf. A096550-A096561 (other pseudo-random number generators).

Programs

  • Mathematica
    NestList[Mod[9806*#, 2^17 - 1] + 1 &, 1, 50] (* Paolo Xausa, May 23 2025 *)

Formula

a(n) = (9806 * a(n-1) mod (2^17-1)) + 1.

A384361 Consecutive internal states of the linear congruential pseudo-random number generator of the HP 48 series calculators when started at 999500333083533.

Original entry on oeis.org

999500333083533, 529199358633911, 43582181444437, 294922982088079, 41089642444893, 284830972469031, 786870433805477, 40703079813759, 869103111377453, 156083179654551, 561556952003317, 315753873725039, 722319935785213, 518159379358471, 201897051493957, 715330849773919
Offset: 1

Views

Author

Paolo Xausa, May 27 2025

Keywords

References

  • The initial 999500333083533 seed is the one used by the calculators after a memory clean; successive executions of the RAND command give the terms of this sequence (divided by 10^15 and truncated to 12 significant digits).
  • See links for more information.

Crossrefs

Cf. A384416 (starting at 1).
Cf. other pseudo-random number generators: A096550-A096561, A381318, A382535, A383809, A384081, A384221.

Programs

  • Mathematica
    NestList[Mod[2851130928467*#, 10^15] &, 999500333083533, 15]

Formula

a(1) = 999500333083533; for n > 1, a(n) = 2851130928467*a(n-1) mod 10^15.

A384416 Consecutive internal states of the linear congruential pseudo-random number generator of the HP 48 series calculators when started at 1.

Original entry on oeis.org

1, 2851130928467, 261097470970089, 335429755623563, 468090732667921, 287888716607107, 194022960814969, 298923961822523, 84062462462241, 191517259514547, 165777802909449, 436661297384683, 996040654470961, 669370619746787, 188023750085529, 201468430854043, 677208350742081
Offset: 1

Views

Author

Paolo Xausa, May 28 2025

Keywords

Comments

To initialize the seed to 1, use the RDZ command with an argument between 10^-16 and 10^-13 (for example, "1E-13 RDZ"). Successive executions of the RAND command give the terms of this sequence (divided by 10^15 and truncated to 12 significant digits).
After a memory clean, the calculators use the seed 999500333083533 (cf. A384361).
See the Meyers link for more information.
Periodic with period 10^14/2.

Crossrefs

Cf. A384361 (starting at the default seed).
Cf. other pseudo-random number generators: A096550-A096561, A381318, A382535, A383809, A384081, A384221.

Programs

  • Mathematica
    NestList[Mod[2851130928467*#, 10^15] &, 1, 20]

Formula

a(1) = 1; for n > 1, a(n) = 2851130928467*a(n-1) mod 10^15.

A096552 Consecutive internal states of the linear congruential pseudo-random number generator MTH$RANDOM that is used in the VAX VMS Library.

Original entry on oeis.org

0, 1, 69070, 475628535, 3277404108, 772999773, 3877832058, 3821835443, 1662200408, 2044158073, 3788989926, 797919023, 2743624612, 1156259413, 1059494674, 584849259, 786050992, 3369345009, 3077427454, 1200308583, 2654771836, 1692139853, 4052415402, 1850655011
Offset: 1

Views

Author

Hugo Pfoertner, Jul 18 2004

Keywords

Comments

This generator is a variant of A096551.

Crossrefs

Cf. A096550-A096561 for other pseudo-random number generators.

Programs

  • Maple
    a:= proc(n) option remember; `if`(n<2, 0,
          irem(69069 *a(n-1)+1, 4294967296))
        end:
    seq(a(n), n=1..30);  # Alois P. Heinz, Jun 10 2014
  • Mathematica
    NestList[Mod[#*69069 + 1, 2^32] &, 0, 50] (* Paolo Xausa, Aug 29 2024 *)

Formula

a(1)=0, a(n) = (69069*a(n-1)+1) mod 2^32. The sequence is periodic with period length 2^32. [Corrected based on a comment from Kevin Ryde, Nov 13 2024]

A096554 Output of the linear congruential pseudo-random number generator used in function rand() as described in Kernighan and Ritchie, when seeded with 0.

Original entry on oeis.org

0, 21468, 9988, 22117, 3498, 16927, 16045, 19741, 12122, 8410, 12261, 27052, 5659, 9758, 21087, 25875, 32368, 26233, 15212, 17661, 20496, 8191, 23065, 23471, 32096, 10781, 14596, 23212, 24244, 5661, 514, 25643, 1350, 19576, 8051, 18234, 16882, 13023, 5983, 21166
Offset: 1

Views

Author

Hugo Pfoertner, Jul 18 2004

Keywords

Comments

This sequence and A061364 are generated by the same algorithm but with different seed: A061364 (as well as A096553 which is the sequence of internal states of the generator) has seed 1, while this sequence has seed 0. [Corrected by Jean-Claude Arbaut, Oct 05 2015]

References

  • Brian W. Kernighan and Dennis M. Ritchie, The C Programming Language (Second Edition), Prentice Hall Software Series, 1988, page 46.

Crossrefs

Cf. A096550-A096561 for other pseudo-random number generators.
A061364 is the same generator seeded with 1.

Programs

  • C
    static unsigned int next = 0; int rand( ) { next = next * 1103515245 + 12345; return ((next >>16) & 32767); }
    
  • Mathematica
    BitShiftRight[NestList[Mod[#*1103515245 + 12345, 2^31] &, 12345, 50], 16] (* Paolo Xausa, Aug 29 2024 *)
  • PARI
    x(n) = if(n<1, 0, (1103515245 * x(n-1) + 12345) % (2^31));
    vector(100, n, floor(x(n)/2^16)) \\ Altug Alkan, Oct 05 2015

Formula

Correction of seed value and second formula from David Fifield, May 23 2024: (Start)
x(0) = 0, x(n) = (1103515245 * x(n-1) + 12345) mod 2^31, a(n) = floor(x(n)/2^16).
a(n) = A061364(n + 1212780038). (End)

Extensions

Name amended (start at 0) by David Fifield, May 23 2024

A096556 Consecutive internal states of the linear congruential pseudo-random number generator used in the Watcom FORTRAN Function URAND when started with SEED=0.

Original entry on oeis.org

0, 453816693, 2013878382, 1461722811, 653338732, 1830525137, 1741773690, 526418231, 109789464, 1577774445, 1454795974, 1716389619, 180917764, 1381854025, 70154322, 301698031, 2068689712, 1594166885, 1923590686, 579939371, 2056610972, 914297537, 1800695338, 1283998631
Offset: 1

Views

Author

Hugo Pfoertner, Jul 20 2004

Keywords

Crossrefs

Cf. A096550-A096561 other pseudo-random number generators.

Programs

  • Maple
    a:= proc(n) option remember; `if`(n<2, 0,
          irem(2147437301 * a(n-1) +453816693, 2147483648))
        end:
    seq(a(n), n=1..30);  # Alois P. Heinz, Jun 10 2014
  • Mathematica
    NestList[Mod[#*2147437301 + 453816693, 2^31] &, 0, 50] (* Paolo Xausa, Aug 29 2024 *)

Formula

a(1)=0, a(n) = ( 2147437301 * a(n-1) + 453816693 ) mod 2^31. The sequence is periodic with period length 2^31.

A096560 Consecutive internal states of the first of the two linear congruential random number generators whose combined output is used in function RANDOM_NUMBER in version 8 of the Intel FORTRAN Compiler for Linux, using its intrinsic initialization.

Original entry on oeis.org

2147483562, 2147443549, 546363367, 801095798, 1707599834, 1415233705, 19915560, 184815967, 1440196129, 286492701, 451678520, 242633072, 2094038248, 332794338, 2034550132, 1534592081, 22528712, 1668269071, 1739534702, 1504321872, 2118598881, 1701974909, 1825258870
Offset: 1

Views

Author

Hugo Pfoertner, Aug 13 2004

Keywords

Comments

Comment from Raymond Wang, Oct 03 2008: (65421664*40014) mod (2^31-85) = 2^31-86.

References

  • P. L'Ecuyer, Efficient and portable combined random number generators, Communications of the ACM, v.31 n.6, p. 742-751 and 774, 1988.

Crossrefs

Cf. A096561.

Programs

  • Maple
    a:= proc(n) option remember; `if`(n=1, 2147483562,
          irem(40014 *a(n-1), 2147483563))
        end:
    seq(a(n), n=1..30);  # Alois P. Heinz, Jun 10 2014
  • Mathematica
    NestList[Mod[#*40014, 2^31 - 85] &, 2^31 - 86, 50] (* Paolo Xausa, Aug 29 2024 *)

Formula

a(1)=2^31-86, a(n)=40014*a(n-1) mod (2^31-85).
Previous Showing 31-40 of 70 results. Next