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.

A385337 Consecutive states of the linear congruential pseudo-random number generator (1291*s + 4621) mod 21870 when started at s=1.

This page as a plain text file.
%I A385337 #11 Jul 08 2025 16:43:33
%S A385337 1,5912,4383,20614,1505,1146,18817,21668,6279,18910,10511,14922,1453,
%T A385337 21494,345,12616,20597,1428,11089,17540,13311,21172,173,9264,1555,86,
%U A385337 6297,20278,5129,21420,14161,3152,6033,7504,3875,20886,2737,17018,17379,2290,8561
%N A385337 Consecutive states of the linear congruential pseudo-random number generator (1291*s + 4621) mod 21870 when started at s=1.
%C A385337 Periodic with period 21870.
%C A385337 Described in Numerical Recipes as a "quick and dirty" generator.
%D A385337 William H. Press, Saul A. Teukolsky, William T. Vetterling, and Brian P. Flannery, Numerical Recipes in C (2nd ed), Cambridge University Press, 1999 (see p. 285).
%H A385337 Sean A. Irvine, <a href="/A385337/b385337.txt">Table of n, a(n) for n = 1..10000</a>
%H A385337 <a href="/index/Ps#PRN">Index entries for sequences related to pseudo-random numbers.</a>
%H A385337 <a href="/index/Rec#order_21870">Index entries for linear recurrences with constant coefficients</a>, order 21870.
%F A385337 a(n) = (1291 * a(n-1) + 4621) mod 21870.
%p A385337 a:= proc(n) option remember; `if`(n<2, n,
%p A385337       irem(1291*a(n-1)+4621, 21870))
%p A385337     end:
%p A385337 seq(a(n), n=1..44);  # after _Alois P. Heinz_
%t A385337 NestList[Mod[1291*# + 4621, 21870] &, 1, 50] (* after _Paolo Xausa_ *)
%Y A385337 Cf. A385078, A385036.
%K A385337 nonn,look,easy
%O A385337 1,2
%A A385337 _Sean A. Irvine_, Jun 25 2025