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 A306612 #46 Sep 04 2019 12:11:43 %S A306612 3,4,7,8,16,16,157,157,16957,19231,80942,82372,82372,9624266,19607227, %T A306612 118867612,4968215191,31090893772,118903377091,187341482252, %U A306612 1784664085208,12330789708022,68016245854132,68016245854132,10065964847743822,74887595879692807,1825207861455319267,98403562254816509476,283462437415903129597,2126598918934702375802 %N A306612 a(n) is the least integer k > 2 such that the remainder of -k modulo p is strictly increasing over the first n primes. %C A306612 0, 1, and 2 satisfy this condition for all p, so this sequence starts at 3. The growth of this sequence is much more irregular than that of the companion sequence A306582. %e A306612 a(n) modulo 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, ... %e A306612 ===== ================================================== %e A306612 3 1, 0, 2, 4, 8, 10, 14, 16, 20, 26, 28, ... %e A306612 4 0, 2, 1, 3, 7, 9, 13, 15, 19, 25, 27, ... %e A306612 7 1, 2, 3, 0, 4, 6, 10, 12, 16, 22, 24, ... %e A306612 8 0, 1, 2, 6, 3, 5, 9, 11, 15, 21, 23, ... %e A306612 16 0, 2, 4, 5, 6, 10, 1, 3, 7, 13, 15, ... %e A306612 157 1, 2, 3, 4, 8, 12, 13, 14, 4, 17, 29, ... %e A306612 16957 1, 2, 3, 4, 5, 8, 9, 10, 17, 8, 0, ... %e A306612 19231 1, 2, 4, 5, 8, 9, 13, 16, 20, 25, 20, ... %e A306612 80942 0, 1, 3, 6, 7, 9, 12, 17, 18, 26, 30, ... %o A306612 (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 A306612 a(n) = {my(k=3); while(!isok(k, n), k++); k;} \\ _Michel Marcus_, Jun 04 2019 %o A306612 (Python) %o A306612 from sympy import prime %o A306612 def A306612(n): %o A306612 plist, x = [prime(i) for i in range(1,n+1)], 3 %o A306612 rlist = [-x % p for p in plist] %o A306612 while True: %o A306612 for i in range(n-1): %o A306612 if rlist[i] >= rlist[i+1]: %o A306612 break %o A306612 else: %o A306612 return x %o A306612 for i in range(n): %o A306612 rlist[i] = (rlist[i] - 1) % plist[i] %o A306612 x += 1 # _Chai Wah Wu_, Jun 15 2019 %Y A306612 Cf. A306582. %K A306612 nonn,hard %O A306612 1,1 %A A306612 _Charlie Neder_, Jun 03 2019 %E A306612 a(16)-a(19) from _Daniel Suteu_, Jun 04 2019 %E A306612 a(20)-a(25) from _Giovanni Resta_, Jun 16 2019 %E A306612 a(26)-a(27) from _Bert Dobbelaere_, Jun 22 2019 %E A306612 a(28)-a(30) from _Bert Dobbelaere_, Sep 04 2019