OFFSET
1,1
COMMENTS
Every term of this sequence must have a Wieferich prime factor (for example 66709 = 19 * 3511). Wieferich prime p = 1093 cannot divide such k, since it would require ord_{p^2}(2) = 364 = 2^2 * 91 to divide 2^k - 2, which is impossible. - Max Alekseyev, Jul 25 2024
MATHEMATICA
f[n_] := Module[{e = IntegerExponent[n^2, 2], d, k, r}, d = n^2 / 2^e; k = MultiplicativeOrder[2, d]; r = PowerMod[2, n, k] - e - 2; r = Mod[r, k]; 2^e * PowerMod[2, r, d]];
q[n_] := PowerMod[2, n-1, n] != 1 && f[n] == 1;
Select[Range[10^6], CompositeQ[#] && q[#] &] (* or: *)
Select[3511 * Range[10^5], q] (* faster, can be used for generating terms up to 4.97*10^17, the current lower bound for A001220(3) *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Thomas Ordowski, Jul 25 2024
EXTENSIONS
More terms from Amiram Eldar, Jul 25 2024
STATUS
approved