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 A334904 #61 Jan 28 2022 12:15:01 %S A334904 1,2,2,1,2,2,1,1,1,1,3,2,3,2,1,2,1,1,2,7,2,3,2,3,1,2,2,2,1,1,3,1,2,2, %T A334904 1,3,2,2,1,2,1,1,7,1,2,3,2,1,2,1,1,7,7,3,1,1,1,6,2,3,2,2,2,11,1,2,2,1, %U A334904 2,2,2,7,1,2,1,1,1,2,3,7,1,2,7,1,3,2,3,3,1,2,2,13 %N A334904 a(n) is the least integer b such that the fractions (b^0)/p, (b^1)/p, ..., (b^(r-1))/p where p is the n-th prime, produce the A006556(n) distinct cycles. %C A334904 With the exception of the prime numbers 2 and 5, the values of r mentioned above form the sequence A006556. %C A334904 Detection of all different cycles of digits in the decimal expansions of 1/p, 2/p, ..., (p-1)/p where p=n-th prime. If for the n-th prime p the number of different cycles of digits is equal to r, then there will be the smallest integer b in the interval 0 < b < p with the following property: The fractions (b^0)/p, (b^1)/p, ..., (b^(r-1))/p will produce r different cycles of digits. In this case the term a(n) of the sequence becomes equal to b. %e A334904 For n=13, prime(13)=41, there are A006556(13)=8 cycles. %e A334904 With b=3, we get (normally, these fractions should be in the form (b^k mod p)/p): %e A334904 frac(3^0 / 41) = 0.02439 (1) %e A334904 frac(3^1 / 41) = 0.07317 (2) %e A334904 frac(3^2 / 41) = 0.21951 (3) %e A334904 frac(3^3 / 41) = 0.65853 (4) %e A334904 frac(3^4 / 41) = 0.97560 (5) %e A334904 frac(3^5 / 41) = 0.92682 (6) %e A334904 frac(3^6 / 41) = 0.78048 (7) %e A334904 frac(3^7 / 41) = 0.34146 (8=r) %e A334904 So a(13) = 3. %o A334904 (PARI) \\ default(realprecision, 1000) %o A334904 nbc(p) = (p-1)/znorder(Mod(10, p)); %o A334904 len(p) = znorder(Mod(10, p)); %o A334904 pad(x, sz) = {while(#digits(x) != sz, x*=10); x;} %o A334904 cmpc(x,y) = {if (x==y, return (0)); my(dx=digits(x), dy=digits(y), v=dx); for (k=1, #dx, v=vector(#v, k, if (k==#v, v[1], v[k+1])); if (v == dy, return (0));); return (1);} %o A334904 decimals(x, sz) = pad(floor(1.0*10^sz*x), sz); %o A334904 a(n) = {my(p=prime(n)); if ((p==2), return (1)); if ((p==5), return (2)); my(sz=len(p), nb=nbc(p), m=1); while (#vecsort(vector(f(p), k, decimals((m^(k-1) % p)/p, sz)),cmpc,8) != nb, m++); m;} \\ _Michel Marcus_, May 29 2020 %Y A334904 Cf. A006556. %K A334904 nonn,base %O A334904 1,2 %A A334904 _George Plousos_, May 15 2020