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.

A152960 Output of linear congruential pseudo-random generator 134775813 for signed 32-bit values.

This page as a plain text file.
%I A152960 #20 Jun 20 2025 17:44:17
%S A152960 0,1,134775814,-596792289,870078620,1172187917,-1410233534,1368768587,
%T A152960 694906232,1598751577,1828254910,352239543,2039224980,303092965,
%U A152960 -683524998,256513635,1259699184,-355259471,1580146294,-967806897,1408429452,-1298476099,-669280590
%N A152960 Output of linear congruential pseudo-random generator 134775813 for signed 32-bit values.
%C A152960 A widely used pseudo-random number generator, for example all Delphi-Versions until now use it for their "Random" function.
%C A152960 It can be shown that the sequence has full period (its length is 2^32).
%H A152960 T. D. Noe, <a href="/A152960/b152960.txt">Table of n, a(n) for n = 0..1000</a>
%H A152960 Wikipedia, <a href="http://en.wikipedia.org/wiki/Linear_congruential_generator">Linear congruential generator</a>
%H A152960 <a href="/index/Ps#PRN">Index entries for sequences related to pseudo-random numbers.</a>
%F A152960 a(n+1) = (134775813 * a(n) + 1)  (mod 2^32) (representatives for the equivalence classes by interpreting the bit-patterns as two's complement).
%t A152960 nn=30; t = {x = 0}; Do[x = Mod[134775813 x + 1, 2^32]; If[x > 2^31, x = x - 2^32]; AppendTo[t, x], {nn}]; t (* _T. D. Noe_, Dec 18 2012 *)
%o A152960 (Delphi) // implementation using Delphi's built-in random() function
%o A152960 var
%o A152960 I: Integer;
%o A152960 begin
%o A152960 Randseed:= 0;
%o A152960 for I:= 1 to 100 do begin
%o A152960 Write(Randseed, ',');
%o A152960 Random;
%o A152960 end;
%o A152960 end.
%o A152960 (PARI) step(n)=(134775813*n+1)%2^32 \\ _Charles R Greathouse IV_, Sep 10 2015
%o A152960 (PARI) a(n)=lift((Mod(134775813,2^34)^n-1)/33693953)/4 \\ _Charles R Greathouse IV_, Sep 10 2015
%Y A152960 Cf. A384404 (internal state).
%K A152960 sign,easy
%O A152960 0,3
%A A152960 _Moritz Franckenstein_, Dec 16 2008