A382224 Numbers k such that every element with maximal order mod k is prime.
3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 16, 18, 20, 22, 24, 28, 30, 36, 42, 54, 60, 78
Offset: 1
Examples
Elements with maximal order mod a(n) for 1 <= n <= 22: 3 [2] 4 [3] 5 [2, 3] 6 [5] 7 [3, 5] 8 [3, 5, 7] 9 [2, 5] 10 [3, 7] 12 [5, 7, 11] 14 [3, 5] 16 [3, 5, 11, 13] 18 [5, 11] 20 [3, 7, 13, 17] 22 [7, 13, 17, 19] 24 [5, 7, 11, 13, 17, 19, 23] 28 [3, 5, 11, 17, 19, 23] 30 [7, 13, 17, 23] 36 [5, 7, 11, 23, 29, 31] 42 [5, 11, 17, 19, 23, 31] 54 [5, 11, 23, 29, 41, 47] 60 [7, 13, 17, 23, 37, 43, 47, 53] 78 [7, 11, 19, 37, 41, 59, 67, 71]
Programs
-
Mathematica
Select[Range[2,100],And@@PrimeQ@Select[Range[(n=#)-1],MultiplicativeOrder[#,n]==CarmichaelLambda[n]&]&] (* Giorgos Kalogeropoulos, Mar 23 2025 *)
-
PARI
isok(n) = my(m=lcm(apply(f->(f[1]-1)*f[1]^(f[2]-1-(f[1]==2&&f[2]>2)), Vec(factor(n)~)))); for(k=1, n-1, if(gcd(k,n)==1 && znorder(Mod(k,n))==m && isprime(k)==0, return(0)); if(k==n-1, return(1)))
Comments