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 A366470 #24 Mar 06 2024 14:48:26 %S A366470 1,0,1,4,4,2,2,0,15,3,1,26,26,24,24,18,18,16,16,12,12,6,81,81,73,73, %T A366470 71,63,57,57,29,29,23,23,13,13,1,158,154,154,148,148,138,138,134,134, %U A366470 122,122,118,118,114,114,112,112,106,106,100,100,94,94,92 %N A366470 a(n) = A364054(n-1) mod prime(n-1). %H A366470 Chai Wah Wu, <a href="/A366470/b366470.txt">Table of n, a(n) for n = 2..10000</a> %H A366470 Michael De Vlieger, <a href="/A366470/a366470_1.png">Log log scatterplot of a(n)</a>, n = 1..2^20. %H A366470 Michael De Vlieger, <a href="/A366470/a366470_2.png">Log log scatterplot of a(n)</a>, n = 2..2^20, showing a(n) = 0 instead as a(n) = 1/10, with a color function showing b(n) = 0 in black, b(n) = 1 in blue, b(n) = 2 in green, b(n) = 3 in chartreuse, and b(n) = 4 in red, where b() = A366475(). (The plot accentuates larger values of b(n) through larger size, so adjacent smaller values may be eclipsed.) %H A366470 Chai Wah Wu, <a href="/A366470/a366470.png">Graph of first 10^8 terms</a> %F A366470 A364054(n) = A366475(n)*prime(n-1) + a(n) for n > 1. - _Michael De Vlieger_, Mar 06 2024 %t A366470 nn = 2^20; c[_] := False; m[_] := 0; j = 1; c[0] = c[1] = True; %t A366470 Monitor[Do[p = Prime[n - 1]; r = Mod[j, p]; %t A366470 While[Set[k, p m[p] + r ]; c[k], m[p]++]; %t A366470 Set[{a[n - 1], c[k], j}, {r, True, k}], {n, 2, nn + 1}], n]; %t A366470 Array[a, nn] (* _Michael De Vlieger_, Oct 27 2023 *) %o A366470 (Python) %o A366470 from itertools import count, islice %o A366470 from sympy import nextprime %o A366470 def A366470_gen(): # generator of terms %o A366470 a, aset, p = 1, {0,1}, 2 %o A366470 while True: %o A366470 yield a %o A366470 for b in count(a,p): %o A366470 if b not in aset: %o A366470 aset.add(b) %o A366470 a = b%(p:=nextprime(p)) %o A366470 break %o A366470 A366470_list = list(islice(A366470_gen(),30)) # _Chai Wah Wu_, Oct 22 2023 %Y A366470 Cf. A364054, A366475. %K A366470 nonn %O A366470 2,4 %A A366470 _N. J. A. Sloane_, Oct 21 2023