Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #7 Sep 08 2022 08:46:08
%S 0,2,0,2,6,2,3,2,10,2,5,6,2,2,0,2,8,2,2,2,22,2,5,2,3,2,12,2,6,2,2,6,2,
%T 2,6,2,2,2,3,2,2,2,2,10,46,2,6,2,2,2,23,2,2,2,2,2,58,2,8,6,2,2,2,2,3,
%U 2,2,2,14,2,7,2,2,2,2,2,12,2,3,3,82,2,2,2
%N a(n) is the least k >= 2 such that k is neither a square modulo n nor a primitive root (mod n), or 0 if no such value exists.
%C a(A019434(n)) = 0 for n >= 1.
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/PrimitiveRoot.html">Primitive Root</a>
%o (Magma) lst:=[]; for n in [3..86] do v:=0; for r in [2..n-1] do if not IsSquare(ResidueClassRing(n)! r) and not IsPrimitive(r, n) then v:=r; break; end if; end for; lst:=Append(lst, v); end for; lst;
%Y Cf. A028730, A136804, A136806.
%K nonn
%O 3,2
%A _Arkadiusz Wesolowski_, May 24 2014