login
A263984
Least composite primitive root of n-th prime.
1
9, 8, 8, 10, 6, 6, 6, 10, 10, 8, 12, 15, 6, 12, 10, 8, 6, 6, 12, 21, 14, 6, 6, 6, 10, 8, 6, 6, 6, 6, 6, 6, 6, 12, 8, 6, 6, 12, 10, 8, 6, 10, 21, 10, 8, 6, 22, 6, 6, 6, 6, 14, 14, 6, 6, 10, 8, 6, 6, 12, 12, 8, 14, 22, 10, 8, 28, 10, 6, 18
OFFSET
1,1
COMMENTS
The only square in the sequence is a(1) = 9.
It seems nearly certain that all nonsquare composite numbers occur in this sequence.
LINKS
MATHEMATICA
primrootQ[n_, r_] := MultiplicativeOrder[r, n] == EulerPhi[n];
a[n_] := Module[{p = Prime[n], k = 6}, While[PrimeQ[k] || GCD[k, p] != 1 || !primrootQ[p, k], k++]; k];
Array[a, 70] (* Jean-François Alcover, Oct 23 2020, after PARI code *)
PROG
(PARI) isprimroot(n, r)=znorder(Mod(r, n))==eulerphi(n)
a(n)=my(p=prime(n), k=6); while(isprime(k)||gcd(k, p)!=1||!isprimroot(p, k), k++); k
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved