OFFSET
1,1
COMMENTS
The corresponding record values are 0, 1, 2, 3, 4, 5, 7, 8, 9, 11, 12, ... (see the link for more values).
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..69 (terms below 10^6)
Amiram Eldar, Table of n, a(n), A371729(a(n)) for n = 1..69.
Wikipedia, Pseudoprime.
MATHEMATICA
f[k_] := Count[Range[4, k - 1], _?(CompositeQ[#] && PowerMod[k, # - 1, #] == 1 &)]; seq[kmax_] := Module[{s = {}, fm = -1, f1}, Do[f1 = f[k]; If[f1 > fm, fm = f1; AppendTo[s, k]], {k, 2, kmax}]; s]; seq[2500]
PROG
(PARI) f(n) = {my(c=0); forcomposite(k = 4, n-1, if(Mod(n, k)^(k-1) == 1, c++)); c; }
lista(kmax) = {my(fm = -1, f1); for(k = 2, kmax, f1 = f(k); if(f1 > fm, fm = f1; print1(k, ", "))); }
CROSSREFS
KEYWORD
nonn
AUTHOR
Amiram Eldar, Apr 05 2024
STATUS
approved