login
A256343
Moduli k for which A248218(k) = 3 (length of the terminating cycle of 0 under x -> x^2+1 modulo k).
4
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,1
COMMENTS
All terms are odd. - Robert Israel, Dec 09 2020
If x is a term and y is a term of this sequence or A248219, then LCM(x,y) is a term. - Robert Israel, Mar 09 2021
LINKS
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 *)
PROG
(PARI) for(i=1, 900, A248218(i)==3&&print1(i", "))
CROSSREFS
KEYWORD
nonn
AUTHOR
M. F. Hasler, Mar 25 2015
STATUS
approved