|
|
A343723
|
|
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.
|
|
0
|
|
|
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, 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, 12, 0, 10, 12, 16, 0, 15, 10, 17, 8, 16, 16, 12, 16, 17, 12, 19
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,11
|
|
LINKS
|
|
|
FORMULA
|
|
|
PROG
|
(PARI) pos(list, r) = forstep (k=#list, 1, -1, if (list[k] == r, return (#list - k + 1)); );
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); ); }
a(n) = sum(r=0, n-1, 1 - isok(r, n))/4; \\ Michel Marcus, May 02 2021
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|