A256343 Moduli k for which A248218(k) = 3 (length of the terminating cycle of 0 under x -> x^2+1 modulo k).
5, 9, 15, 25, 27, 35, 45, 59, 63, 75, 95, 97, 105, 125, 135, 155, 171, 175, 177, 185, 189, 215, 225, 251, 279, 285, 291, 295, 315, 333, 375, 379, 387, 413, 419, 465, 475, 485, 513, 525, 531, 555, 617, 625, 645, 665, 675, 679, 753, 775, 785, 837, 855, 863, 873, 875, 885
Offset: 1
Keywords
Links
- Robert Israel, Table of n, a(n) for n = 1..7000
Programs
-
Maple
f:= proc(n) local x, S, R,i; R:= Array(0..n,-1): R[0]:= 0: x:= 0; for i from 1 do x:= x^2+1 mod n; if R[x] >= 0 then return i - R[x] fi; R[x]:= i; od end proc: select(f=3, [seq(i,i=1..1000,2)]); # Robert Israel, Dec 09 2020
-
Mathematica
f[n_] := Module[{x, R, i}, R[_] = -1; R[0] = 0; x = 0; For[i = 1, True, i++, x = Mod[x^2+1, n]; If[R[x] >= 0, Return[i - R[x]]]; R[x] = i]]; Select[Table[i, {i, 1, 1000, 2}], f[#] == 3&] (* Jean-François Alcover, Feb 03 2023, after Robert Israel *)
-
PARI
for(i=1,900,A248218(i)==3&&print1(i","))
Comments