cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A039733 a(n)=k such that prime(k) is the prime q

Original entry on oeis.org

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

Views

Author

Keywords

Crossrefs

Cf. A039734.

Programs

  • 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 *)
  • 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