%I #10 Nov 14 2013 17:11:55
%S 8,1,5,0,11,0,19,0,17,0,23,0,29,0,0,0,41,0,81,0,67,0,47,0,53,0,0,0,59,
%T 0,0,0,97,0,0,0,109,0,0,0,83,0,0,0,139,0,0,0,113,0,0,0,107,0,163,0,0,
%U 0,0,0,199,0,0,0,137,0,0,0,0,0,0,0,149,0,0,0,0,0
%N Smallest positive number which has exactly n primitive roots, or 0 if no such number exists.
%C If n >= 3 and n is odd, then a(n) = 0.
%H T. D. Noe, <a href="/A231772/b231772.txt">Table of n, a(n) for n = 0..10000</a>
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/PrimitiveRoot.html">Primitive Root</a>
%t nn = 100; t = Join[{1}, Table[p = PrimitiveRoot[n]; If[IntegerQ[p], EulerPhi[EulerPhi[n]], 0], {n, 2, 2*nn}]]; Table[s = Position[t, n, 1, 1]; If[s == {}, 0, s[[1, 1]]], {n, 0, nn}] (* _T. D. Noe_, Nov 14 2013 *)
%o (PARI) r=77; print1(8, ", ", 1, ", "); for(n=2, r, m=0; for(c=2*n+1, n^2+1, if(n%2==1, break); e=eulerphi(c); if(e==lcm(znstar(c)[2])&&eulerphi(e)==n, m=1; print1(c, ", "); break)); if(m==0, print1(0, ", ")));
%Y Cf. A007617, A010554, A046144, A231773.
%K nonn
%O 0,1
%A _Arkadiusz Wesolowski_, Nov 13 2013