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.
%I A384085 #20 May 28 2025 20:58:28 %S A384085 1,36,707,574,357,425,229,408,278,181,675,23,187,186,146,4,156,404, %T A384085 118,342,554,286,501,353,265,390,287,541,495,113,142,573,317,283,381, %U A384085 656,721,405,158,484,402,38,58,129,53,658,72,689,583,717,245,319,363,665 %N A384085 Consecutive states of the linear congruential pseudo-random number generator (40*s+725) mod 729 when started at s=1. %C A384085 Periodic with period 729. %C A384085 Originally defined by Savitch in the form (40*s+3641) mod 729, even though 3641 > 729. %D A384085 Walter J. Savitch, Pascal: An Introduction to the Art and Science of Programming, Benjamin Cummings, 1984 (see p. 244). %H A384085 Sean A. Irvine, <a href="/A384085/b384085.txt">Table of n, a(n) for n = 1..729</a> %H A384085 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 A384085 <a href="/index/Ps#PRN">Index entries for sequences related to pseudo-random numbers</a>. %H A384085 <a href="/index/Rec#order_729">Index entries for linear recurrences with constant coefficients</a>, order 729. %F A384085 a(n) = (40*a(n-1) + 725) mod 729. %p A384085 a:= proc(n) option remember; `if`(n<2, n, %p A384085 irem(40*a(n-1)+725, 729)) %p A384085 end: %p A384085 seq(a(n), n=1..54); # _Alois P. Heinz_, May 18 2025 %t A384085 NestList[Mod[40*# + 725, 729] &, 1, 100] (* _Paolo Xausa_, May 22 2025 *) %Y A384085 Cf. A096550-A096561 other pseudo-random number generators. %K A384085 nonn,easy %O A384085 1,2 %A A384085 _Sean A. Irvine_, May 18 2025