login
Consecutive states of the linear congruential pseudo-random number generator 259*s mod 2^15 when started at s=1.
5

%I #19 Jun 15 2025 22:36:22

%S 1,259,1545,6939,27729,5619,13529,30603,29089,30179,17577,30459,24561,

%T 4307,1401,2411,1857,22211,18249,7899,14225,14259,23065,10059,16609,

%U 9123,3561,4795,29489,2707,12985,20779,7809,23683,6281,21147,4817,2419,3929,1803,8225

%N Consecutive states of the linear congruential pseudo-random number generator 259*s mod 2^15 when started at s=1.

%C Periodic with period 8192 (considerably less than the modulus).

%C A 16-bit version of RANDU (A096555) that suffers from all the same problems.

%D Byron S. Gottfried, Schaum's Outline of Theory and Problems of Programming with Pascal, McGraw-Hill, 1985 (see p. 143).

%H Sean A. Irvine, <a href="/A384194/b384194.txt">Table of n, a(n) for n = 1..8192</a>

%H Stephen K. Park and Keith W. Miller, <a href="https://doi.org/10.1145/63039.63042">Random number generators: good ones are hard to find</a>, Communications of the ACM, Vol 31, 10 (1988), 192-201.

%H W. E. Sharp and Carter Bays, <a href="https://doi.org/10.1016/0098-3004(92)90060-5">A review of portable random number generators</a>, Computers and Geosciences, 18, 1 (1982), 79-87.

%H <a href="/index/Ps#PRN">Index entries for sequences related to pseudo-random numbers</a>.

%F a(n) = 259 * a(n-1) mod 2^15.

%p a:= proc(n) option remember; `if`(n<2, n,

%p irem(259*a(n-1), 2^15))

%p end:

%p seq(a(n), n=1..41); # _Alois P. Heinz_, May 21 2025

%t NestList[Mod[259*#, 2^15] &, 1, 100] (* _Paolo Xausa_, May 22 2025 *)

%Y Cf. A096555, A384158.

%K nonn,easy

%O 1,2

%A _Sean A. Irvine_, May 21 2025