OFFSET
1,11
EXAMPLE
a(5)=0 because none of C(1) to C(4) is a QR of C(5)=2821.
a(6)=1 because C(4)=2465 is a QR of C(6)=6601.
a(7)=1 because C(3)=1729 is a QR of C(7)=8911.
a(11)=2 because C(5)=2821 and C(6)=6601 are QR's of C(11)=41041.
a(12)=3 because C(5)=2821, C(8)=10585 and C(10)= 29341 are QR's of C(12)=46657.
MAPLE
MATHEMATICA
L = Cases[Import["https://oeis.org/A002997/b002997.txt", "Table"], {_, _}][[All, 2]];
quadres[q_, p_] := Module[{k}, For[k = 1, k <= Floor[p/2], k++, If[q == PowerMod[k, 2, p], Return[1]]]; -1];
a[n_] := a[n] = Module[{k = 0, i}, For[i = 1, i <= n-1, i++, If[quadres[L[[i]], L[[n]]] == 1, k++]]; k];
Table[Print[n, " ", a[n]]; a[n], {n, 1, 60}] (* Jean-François Alcover, Jan 23 2023, after Maple program *)
CROSSREFS
KEYWORD
nonn
AUTHOR
R. J. Mathar, Jan 12 2023
STATUS
approved