login
A359729
The number of Carmichael numbers smaller than the n-th Carmichael number which are quadratic residues of the n-th Carmichael number.
2
0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 2, 3, 4, 2, 3, 2, 2, 3, 2, 3, 3, 3, 2, 0, 3, 4, 2, 6, 7, 1, 1, 7, 5, 7, 3, 8, 3, 6, 7, 5, 5, 7, 7, 8, 6, 5, 6, 6, 12, 10, 1, 6, 9, 7, 6, 9, 4, 7, 7, 8, 8, 2, 3, 10, 6, 12, 8, 7, 8, 6, 12, 12, 12, 9, 6, 16, 8, 9, 8, 10, 15, 9, 8, 7, 13, 9, 12, 11, 10, 12, 13, 10, 18, 7
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
L := BFILETOLIST("b002997.txt") ;
# count how many Carm's smaller than Carm(n) which are q.reds. exist.
A359729 := proc(n)
global L ;
local a, i;
a := 0 ;
for i from 1 to n-1 do
if numtheory[quadres](op(i, L), op(n, L)) = 1 then
a := a+1 ;
end if;
end do:
a ;
end proc:
seq(A359729(n), n=1..60) ;
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