%I #9 May 07 2021 00:43:29
%S 0,0,0,0,0,0,1,0,1,0,2,0,2,2,0,0,0,2,4,0,3,4,5,0,4,4,4,4,6,0,7,0,6,0,
%T 5,4,8,8,6,0,8,6,10,8,5,10,11,0,10,8,0,8,12,8,10,8,12,12,14,0,14,14,
%U 12,0,10,12,16,0,15,10,17,8,16,16,12,16,17,12,19
%N a(n) is 1/4 of the number of starting residues r modulo n from which repeated iterations of the mapping r -> r^2 mod n never reach a fixed point.
%F a(n) = A343722(n)/4.
%o (PARI) pos(list, r) = forstep (k=#list, 1, -1, if (list[k] == r, return (#list - k + 1)););
%o isok(r, n) = {my(list = List()); listput(list, r); for (k=1, oo, r = lift(Mod(r, n)^2); my(i = pos(list, r)); if (i==1, return (1)); if (i>1, return(0)); listput(list, r); );}
%o a(n) = sum(r=0, n-1, 1 - isok(r, n))/4; \\ _Michel Marcus_, May 02 2021
%Y Cf. A343722.
%K nonn
%O 1,11
%A _Jon E. Schoenfield_, May 02 2021
|