OFFSET
2,1
COMMENTS
MATHEMATICA
a[n_] := Module[{k=4}, While[PrimeQ[k] || !Divisible[n^(k-1)-1, (n^2-1)k], k++]; k]; Array[a, 100, 2] (* Amiram Eldar, Nov 27 2018 *)
PROG
(PARI) a(n) = {forcomposite(k=1, , if (Mod(n, (n^2-1)*k)^(k-1) == 1, return (k)); ); } \\ Michel Marcus, Nov 28 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
Thomas Ordowski, Nov 27 2018
EXTENSIONS
More terms from Amiram Eldar, Nov 27 2018
STATUS
approved