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 76 results. Next

A221556 Consecutive values produced by the C++ minstd_rand random number generator with the default seed (1).

Original entry on oeis.org

48271, 182605794, 1291394886, 1914720637, 2078669041, 407355683, 1105902161, 854716505, 564586691, 1596680831, 192302371, 1203428207, 1250328747, 1738531149, 1271135913, 1098894339, 1882556969, 2136927794, 1559527823, 2075782095, 638022372, 914937185, 1931656580
Offset: 1

Views

Author

Eric M. Schmidt, Jan 19 2013

Keywords

Comments

This is a linear congruential random number generator with multiplier 48271.
Periodic with period 2^31-2. - Sean A. Irvine, May 30 2025

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; `if`(n=0, 1,
          irem(48271 *a(n-1), 2147483647))
        end:
    seq(a(n), n=1..30);  # Alois P. Heinz, Oct 25 2017
  • Mathematica
    f[n_] := PowerMod[48271, n, 2^31 -1]; Array[f, 23] (* Robert G. Wilson v, Nov 10 2014 *)

Formula

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

A357907 The internal state of the Sinclair ZX81 and Spectrum random number generator.

Original entry on oeis.org

1, 149, 11249, 57305, 38044, 35283, 24819, 26463, 18689, 25472, 9901, 21742, 57836, 12332, 7456, 34978, 1944, 14800, 61482, 23634, 3125, 37838, 19833, 45735, 22275, 32274, 61292, 9384, 48504, 33339, 10093, 36142, 23707, 8600, 55241, 14318, 25332, 64938, 20686, 44173, 36199, 27982
Offset: 1

Views

Author

Jacques Basaldúa, Oct 19 2022

Keywords

Comments

The ZX81 had a congruential random number generator with the hardcoded values: x <- (75*x + 74) mod 65537.
This sequence starts with x = 1. The ZX81 had the option to start with a hardware counter.
The sequence has period 2^16. - Rémy Sigrist, Oct 20 2022
The ZX81 returned these values divided by 65536 as floating-point numbers, however, the seed was set as an integer using RAND (or RANDOMIZE on the ZX Spectrum). To produce the sequence as given here on the ZX81, set the seed with RAND 25340 (the last value in the period before it returns to 1), then print successive values with PRINT 65536*RND. On the ZX81, the current seed was stored in memory locations 16343 and 16384, and could be retrieved with PRINT 256*PEEK 16435+PEEK 16434 (which is equivalent to PRINT 65536*RND, but does not trigger stepping to the next value). - Sean A. Irvine, May 08 2025

Crossrefs

Programs

  • Mathematica
    NestList[Mod[75*# + 74, 65537] &, 1, 50] (* Paolo Xausa, Oct 03 2024 *)
  • PARI
    my(c=Mod(75,65537)); a(n) = lift(2*c^(n-1) - 1); \\ Kevin Ryde, Oct 22 2022
    
  • Python
    def a(n): return (2*pow(75, n-1, 65537) - 1)%65537
    print([a(n) for n in range(1, 43)]) # Michael S. Branicky, Oct 23 2022
  • R
    x <- 1
    nxt <- function(x) (75*x + 74) %% 65537
    for (t in 1:1000) {
      cat(sprintf('%i, ', x))
      x <- nxt(x)
    }
    

Formula

a(n) = (75*a(n-1) + 74) mod 65537, a(1) = 1.
a(n + 2^16) = a(n). - Rémy Sigrist, Oct 20 2022
a(n) = (2*75^(n-1) - 1) mod 65537. - Kevin Ryde, Oct 20 2022
a(n) = a(n-1) - a(n-32768) + a(n-32769) for n > 32769. - Ray Chandler, Aug 03 2023

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.

A384406 Consecutive internal states of the IMSL pseudo-random number generator RNUN when started with ISEED=1 and RNOPT=3.

Original entry on oeis.org

1, 397204094, 2083249653, 858616159, 557054349, 1979126465, 2081507258, 1166038895, 1141799280, 106931857, 142950581, 1759473232, 1125003378, 1832650327, 144277780, 2055193084, 638219178, 585429359, 1481612600, 2097586569, 486421192, 1477976737, 886403653
Offset: 1

Views

Author

Sean A. Irvine, May 27 2025

Keywords

Comments

Periodic with period 2^31-2.
Also used by SAS and GPSS/PC.

Crossrefs

Cf. A096550.

Programs

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

Formula

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

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.

A384429 Consecutive states of the linear congruential pseudo-random number generator for Prime Sheffield Pascal when started at 1.

Original entry on oeis.org

1, 16807, 282475249, 1622647863, 947787489, 1578110407, 1878557649, 613813847, 2005365185, 1564292583, 1570623665, 602936439, 1724879009, 1159739911, 1187094929, 1381381783, 437908353, 499227175, 292517489, 751367351, 1027218017, 832165447, 1791151953
Offset: 1

Views

Author

Sean A. Irvine, May 28 2025

Keywords

Comments

Periodic with period 2^28 (considerably less than the modulus).
A weak version of A096550.

References

  • J. R. Gilbert, The University of Sheffield Pascal System for Prime Computers, University of Sheffield, 1987 (see p. 10).

Crossrefs

Cf. A096550.

Programs

  • Mathematica
    NestList[Mod[16807*#, 2^31] &, 1, 50] (* Paolo Xausa, May 30 2025 *)

Formula

a(n) = 16807 * a(n-1) mod 2^31.
Previous Showing 31-40 of 76 results. Next