login
A039733
a(n)=k such that prime(k) is the prime q<prime(n) for which (prime(n) mod q) is maximal.
2
1, 2, 3, 4, 4, 5, 5, 6, 7, 7, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 13, 14, 15, 16, 16, 16, 17, 17, 17, 19, 19, 20, 20, 22, 22, 22, 23, 24, 24, 25, 25, 25, 25, 26, 26, 28, 30, 31, 31, 31, 31, 31, 31, 32, 33, 33, 33, 34, 35, 35, 35, 37, 37, 37
OFFSET
2,2
LINKS
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
Cf. A039734.
Sequence in context: A071521 A204330 A225553 * A179510 A005374 A206767
KEYWORD
nonn
STATUS
approved