OFFSET
2,1
LINKS
Ivan Neretin, Table of n, a(n) for n = 2..10000
MATHEMATICA
Table[Sort[Prime@Range@n, Mod[Prime[n], #1] > Mod[Prime[n], #2] &][[1]], {n, 2, 58}] (* Ivan Neretin, Feb 23 2018 *)
PROG
(PARI) a(n) = {theq = 0; modmax = 0; pr = prime(n); forprime(q = 2, pr-1, mq = pr % q; if (mq > modmax, modmax = mq; theq = q); ); theq; } \\ Michel Marcus, Oct 02 2013
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved