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”).

A062117
Order of 3 mod n-th prime.
22
1, 0, 4, 6, 5, 3, 16, 18, 11, 28, 30, 18, 8, 42, 23, 52, 29, 10, 22, 35, 12, 78, 41, 88, 48, 100, 34, 53, 27, 112, 126, 65, 136, 138, 148, 50, 78, 162, 83, 172, 89, 45, 95, 16, 196, 198, 210, 222, 113, 57, 232, 119, 120, 125, 256, 131, 268, 30, 69, 280, 282, 292, 34
OFFSET
1,3
EXAMPLE
The 3rd prime is 5 and mod 5, 3^4 = 1, so a(3) = 4.
MATHEMATICA
Table[With[{p=Prime[n]}, If[p==3, 0, MultiplicativeOrder[3, p]]], {n, 63}] (* Ray Chandler, Apr 06 2016 *)
PROG
(GAP) A000040:=Filtered([1..350], IsPrime);;
List([1..Length(A000040)], n->OrderMod(3, A000040[n])); # Muniru A Asiru, Feb 07 2019
(Python)
from sympy import n_order, prime
def A062117(n): return n_order(3, prime(n)) if n != 2 else 0 # Chai Wah Wu, Nov 10 2023
(PARI) a(n, {base=3}) = my(p=prime(n)); if(base%p, znorder(Mod(base, p)), 0) \\ Jianing Song, May 13 2024
CROSSREFS
Cf. A019334 (full reptend primes in base 3).
Sequence in context: A256682 A303404 A002245 * A200497 A271365 A088559
KEYWORD
easy,nonn
AUTHOR
Olivier Gérard, Jun 06 2001
STATUS
approved