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 A094593 #17 Jan 16 2020 01:00:46 %S A094593 1,1,2,4,1,1,2,1,1,2,5,1,2,1,2,6,3,2,6,1,2,1,2,1,3,2,4,1,1,2,1,1,1,3, %T A094593 2,1,2,1,2,4,2,12,1,1,1,1,2,4,1,2,2,2,1,2,1,9,4,1,1,1,9,2,8,1,1,2,2,2, %U A094593 1,2,3,2,1,2,1,2,1,2,2,4,10,16,3,2,1,2 %N A094593 a(n) = (p-1)/x, where p = prime(n) and x = ord(3,p), the smallest positive integer such that 3^x == 1 mod p. %H A094593 T. D. Noe, <a href="/A094593/b094593.txt">Table of n, a(n) for n = 3..1000</a> %F A094593 a(n) = (A000040(n)-1)/A062117(n). %o A094593 (PARI) a(n)=(prime(n)-1)/if(n<0,0,k=1;while((3^k-1)%prime(n)>0,k++);k) %o A094593 (Python) %o A094593 from sympy import prime, n_order %o A094593 def A094593(n): %o A094593 p = prime(n) %o A094593 return 1 if n == 3 else (p-1)//n_order(3,p) # _Chai Wah Wu_, Jan 15 2020 %Y A094593 Cf. A001917. %K A094593 nonn %O A094593 3,3 %A A094593 _Benoit Cloitre_, Jun 06 2004