OFFSET
2,2
LINKS
Ivan Neretin, Table of n, a(n) for n = 2..10000
MATHEMATICA
{1}~Join~Reap[Do[d = 2; r = 0; p = Prime[n];
While[Set[s, Mod[p, Set[q, NextPrime[p/d]] ]]; If[s > r, r = s]; r < q,
d++; If[r == s, Sow[PrimePi@ q]]], {n, 3, 1000}] ][[-1, 1]] (* Michael De Vlieger, Feb 06 2024 *)
PROG
(PARI) a(n) = {thek = 0; modmax = 0; pr = prime(n); for(k = 1, n-1, mq = pr % prime(k); if (mq > modmax, modmax = mq; thek = k); ); thek; } \\ Michel Marcus, Oct 02 2013
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved