login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

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.
9
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, 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, 1, 2, 3, 2, 1, 2, 1, 2, 1, 2, 2, 4, 10, 16, 3, 2, 1, 2
OFFSET
3,3
FORMULA
a(n) = (A000040(n)-1)/A062117(n).
PROG
(PARI) a(n)=(prime(n)-1)/if(n<0, 0, k=1; while((3^k-1)%prime(n)>0, k++); k)
(Python)
from sympy import prime, n_order
def A094593(n):
p = prime(n)
return 1 if n == 3 else (p-1)//n_order(3, p) # Chai Wah Wu, Jan 15 2020
CROSSREFS
Cf. A001917.
Sequence in context: A177196 A010741 A094643 * A327814 A188348 A336434
KEYWORD
nonn
AUTHOR
Benoit Cloitre, Jun 06 2004
STATUS
approved