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
Amiram Eldar, Table of n, a(n) for n = 1..10000
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
Franklin T. Adams-Watters, Oct 31 2015
STATUS
approved