OFFSET
1,3
LINKS
T. D. Noe, Table of n, a(n) for n = 1..10000
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);;
(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
KEYWORD
easy,nonn
AUTHOR
Olivier Gérard, Jun 06 2001
STATUS
approved