A366982 a(n) is the smallest odd k > 1 such that n^((k+1)/2) == n (mod k).
3, 3, 7, 3, 3, 5, 3, 3, 7, 3, 3, 5, 3, 3, 5, 3, 3, 9, 3, 3, 5, 3, 3, 7, 3, 3, 5, 3, 3, 5, 3, 3, 7, 3, 3, 5, 3, 3, 11, 3, 3, 5, 3, 3, 5, 3, 3, 11, 3, 3, 5, 3, 3, 7, 3, 3, 5, 3, 3, 5, 3, 3, 9, 3, 3, 5, 3, 3, 13, 3, 3, 5, 3, 3, 5, 3, 3, 7, 3, 3, 5, 3, 3, 17, 3, 3
Offset: 0
Keywords
Links
- Antti Karttunen, Table of n, a(n) for n = 0..65537
Programs
-
Mathematica
a[n_] := Module[{k = 3}, While[PowerMod[n, (k + 1)/2, k] != Mod[n, k], k += 2]; k]; Array[a, 100, 0] (* Amiram Eldar, Oct 30 2023 *)
-
PARI
a(n) = my(k=3); while (Mod(n, k)^((k+1)/2) != n, k+=2); k; \\ Michel Marcus, Oct 31 2023
Extensions
More terms from Amiram Eldar, Oct 30 2023
Comments