login
A039734
a(n)=the prime q<prime(n) for which (prime(n) mod q) is maximal.
6
2, 3, 5, 7, 7, 11, 11, 13, 17, 17, 19, 23, 23, 29, 29, 31, 31, 37, 37, 37, 41, 43, 47, 53, 53, 53, 59, 59, 59, 67, 67, 71, 71, 79, 79, 79, 83, 89, 89, 97, 97, 97, 97, 101, 101, 107, 113, 127, 127, 127, 127, 127, 127, 131, 137, 137, 137
OFFSET
2,1
LINKS
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
Sequence in context: A195882 A332333 A156900 * A020482 A060308 A224911
KEYWORD
nonn
STATUS
approved