OFFSET
1,1
COMMENTS
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
MAPLE
filter:= proc(p) local m; uses NumberTheory;
if not isprime(p) then return false fi;
if p mod 4 = 1 then return true fi;
m:= Totient(Totient(p))/2;
PrimitiveRoot(p, ith=m+1)=PrimitiveRoot(p, greaterthan=floor(p/2))
end proc:
select(filter, [seq(i, i=5..1000, 2)]); # Robert Israel, Nov 23 2019
MATHEMATICA
<< NumberTheory`NumberTheoryFunctions` m = 2; s = {}; While[m < 10000, m++; p = Prime[m]; If[Mod[p, 4] == 1, s = {s, p}, q = (p - 1)/2; g = PrimitiveRoot[p]; se = Select[Range[p - 1], GCD[ #, p - 1] == 1 &]; e = Length[se]; j = 0; t = 0; While[j < e, j++; h = PowerMod[g, se[[j]], p]; If[h <= q, t = t + 1, ] ]; If[e == 2t, s = {s, p}, ] ] ]; s = Flatten[s]
CROSSREFS
KEYWORD
nonn
AUTHOR
Emmanuel Vantieghem, Feb 04 2010
STATUS
approved