OFFSET
1,1
COMMENTS
Primes p such that the multiplicative order of 9 modulo p is of the maximum possible value.
Primes p such that 3 or -3 (or both) is a primitive root modulo p. Proof of equivalence: let ord(a,k) be the multiplicative order of a modulo p. if ord(3,p) = p-1, then clearly ord(9,p) = (p-1)/2. If ord(-3,p) = p-1, then we also have ord(9,p) = (p-1)/2. Conversely, suppose that ord(9,p) = (p-1)/2, then ord(3,p) = p-1 or (p-1)/2, and ord(-3,p) = p-1 or (p-1)/2. If ord(3,p) = ord(-3,p) = (p-1)/2, then we have that (p-1)/2 is odd and (-1)^((p-1)/2) == 1 (mod p), a contradiction.
A prime p is a term if and only if one of the two following conditions holds: (a) 3 is a primitive root modulo p; (b) p == 3 (mod 4), and the multiplicative order of 3 modulo p is (p-1)/2 (in this case, we have p == 11 (mod 12) since 3 is a quadratic residue modulo p).
A prime p is a term if and only if one of the two following conditions holds: (a) -3 is a primitive root modulo p; (b) p == 3 (mod 4), and the multiplicative order of -3 modulo p is (p-1)/2 (in this case, we have p == 7 (mod 12) since -3 is a quadratic residue modulo p).
No terms are congruent to 1 modulo 12, since otherwise we would have 9^((p-1)/4) = (+-3)^((p-1)/2) == 1 (mod p). - Jianing Song, May 14 2024
LINKS
Jianing Song, Table of n, a(n) for n = 1..10000
EXAMPLE
7 is a term since the multiplicative order of 9 modulo 7 is 3 = (7-1)/2.
MATHEMATICA
okQ[p_] := MultiplicativeOrder[9, p] == (p - 1)/2;
Select[Prime[Range[100]], okQ] (* Jean-François Alcover, Nov 24 2024 *)
PROG
(PARI) isA364867(p) = isprime(p) && (p!=3) && znorder(Mod(9, p)) == (p-1)/2
(Python)
from sympy import n_order, nextprime
from itertools import islice
def A364867_gen(startvalue=4): # generator of terms >= startvalue
p = max(startvalue-1, 3)
while (p:=nextprime(p)):
if n_order(9, p) == p-1>>1:
yield p
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Jianing Song, Aug 11 2023
STATUS
approved