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 A306582 #54 Sep 05 2019 12:05:59 %S A306582 0,2,4,34,52,194,502,1138,4042,5794,5794,62488,798298,5314448, %T A306582 41592688,483815692,483815692,5037219688,18517814158,18517814158, %U A306582 19566774820732,55249201504132,1257253598786974,6743244322196288,24165921989926702,24165921989926702,5346711077171356252,47449991406350138602,278545375679341352084,5604477496256287791854 %N A306582 a(n) is the least integer k such that the remainder of k modulo p is strictly increasing over the first n primes. %C A306582 If "strictly increasing" is replaced with "nondecreasing", this sequence becomes A000004. %C A306582 Trivially, a(n) <= A002110(n)-2. Equality only holds for n = 0. %e A306582 a(n) modulo 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, ... %e A306582 ==== ================================================== %e A306582 0 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ... %e A306582 2 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ... %e A306582 4 0, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, ... %e A306582 34 0, 1, 4, 6, 1, 8, 0, 15, 11, 5, 3, ... %e A306582 52 0, 1, 2, 3, 8, 0, 1, 14, 6, 23, 21, ... %e A306582 194 0, 2, 4, 5, 7, 12, 7, 4, 10, 20, 8, ... %e A306582 502 0, 1, 2, 5, 7, 8, 9, 8, 19, 9, 6, ... %e A306582 1138 0, 1, 3, 4, 5, 7, 16, 17, 11, 7, 22, ... %e A306582 4042 0, 1, 2, 3, 5, 12, 13, 14, 17, 11, 12, ... %e A306582 5794 0, 1, 4, 5, 8, 9, 14, 18, 21, 23, 28, ... %o A306582 (PARI) isok(k, n) = {my(last = -1, cur); for (i=1, n, cur = k % prime(i); if (cur <= last, return (0)); last = cur;); return (1);} %o A306582 a(n) = {my(k=0); while(!isok(k, n), k++); k;} \\ _Michel Marcus_, Jun 04 2019 %o A306582 (Python) %o A306582 from sympy import prime %o A306582 def A306582(n): %o A306582 plist, rlist, x = [prime(i) for i in range(1,n+1)], [0]*n, 0 %o A306582 while True: %o A306582 for i in range(n-1): %o A306582 if rlist[i] >= rlist[i+1]: %o A306582 break %o A306582 else: %o A306582 return x %o A306582 for i in range(n): %o A306582 rlist[i] = (rlist[i] + 1) % plist[i] %o A306582 x += 1 # _Chai Wah Wu_, Jun 15 2019 %Y A306582 Cf. A000004, A002110, A306612, A325057. %K A306582 nonn,hard %O A306582 1,2 %A A306582 _Charlie Neder_, Jun 03 2019 %E A306582 a(16)-a(20) from _Daniel Suteu_, Jun 03 2019 %E A306582 a(21)-a(23) from _Giovanni Resta_, Jun 16 2019 %E A306582 a(24)-a(27) from _Bert Dobbelaere_, Jun 22 2019 %E A306582 a(28)-a(30) from _Bert Dobbelaere_, Sep 05 2019