OFFSET
1,1
COMMENTS
MATHEMATICA
Den[n_] := Times @@ (1 + Select[Divisors[n], PrimeQ[# + 1] &]); q[k_] := Module[{m = 2, d = Den[k - 1]}, If[PowerMod[d, k - 1, k] != 1, False, While[m < d && PowerMod[m, k - 1, k] != 1, m++]; m == d]]; Select[Range[3, 10^6, 2], q] (* Amiram Eldar, Sep 04 2021 *)
PROG
(PARI) f(n) = my(m=2); while(Mod(m, n)^(n-1)!=1, m++); m;
isok(m) = f(m) == denominator(bernfrac(m-1)); \\ Michel Marcus, Sep 04 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Thomas Ordowski, Sep 04 2021
EXTENSIONS
More terms from Amiram Eldar, Sep 04 2021
STATUS
approved