login
a(n) = number of squarefree quadratic non-residues of n.
1

%I #6 Jul 23 2013 08:17:42

%S 0,0,1,2,2,2,3,5,4,3,4,7,5,5,7,10,7,8,6,11,10,8,10,15,10,8,11,15,10,

%T 12,12,18,15,11,15,21,13,13,19,25,16,19,14,25,24,17,19,29,19,18,21,28,

%U 17,22,25,33,25,18,19,35,21,22,32,34,28,29,20,36,33,31,29,44,26,23

%N a(n) = number of squarefree quadratic non-residues of n.

%H C. H. Gribble, <a href="/A165918/b165918.txt">Table of n, a(n) for n=1,...,1000</a>.

%o (PARI) squares(n) = {local(s = Set()); for (j=1, n, s = setunion(s, Set(j^2 % n));); return (s);}

%o qnonr(n) = {local(s = Set()); sq = squares(n);for (j=0, n-1, if (length(setintersect(Set(j), sq))==0, s = setunion(s, Set(j)));); return (s);}

%o a(n) = {s = Set(); qnr = qnonr(n); for (j=1, #qnr, if (issquarefree(eval(qnr[j])), s = setunion(s, Set(qnr[j])));); return (#s);} \\ _Michel Marcus_, Jul 23 2013

%Y Cf. A165916.

%K nonn

%O 1,4

%A _Christopher Hunt Gribble_, Sep 30 2009

%E a(1) added by _Christopher Hunt Gribble_, Oct 05 2009