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.

A188815 Least prime p such that prime(n) divides p + nextprime(p).

Original entry on oeis.org

3, 5, 2, 19, 97, 23, 31, 73, 67, 347, 89, 109, 199, 83, 281, 631, 233, 607, 131, 421, 727, 1103, 743, 353, 577, 907, 307, 641, 433, 1237, 251, 389, 271, 829, 593, 449, 1879, 487, 331, 3109, 1609, 3257, 1907, 383, 2357, 1987, 3163, 443, 2719, 683, 1861, 6211, 719, 2251, 769, 3943, 5647, 2437, 4153, 3371, 563, 877, 3677, 929, 937
Offset: 1

Views

Author

Michel Lagneau, Apr 11 2011

Keywords

Examples

			a(5) = 97 because 97 + 101 = 198, and prime(5) = 11 is the largest prime divisor
  of 198.
		

Crossrefs

Cf. A000040.

Programs

  • Maple
    with(numtheory):for n from 1 to 100 do: nn:=ithprime(n):id:=0:for k from 1
      to 2000 while(id=0) do:x:=ithprime(k+1)+ithprime(k): if irem(x,nn)=0 then id:=1:printf(`%d,
      `, ithprime(k)):else fi:od:od:
  • Mathematica
    Table[p = 2; q = 3; While[Mod[p + q, Prime[n]] > 0, p = q; q = NextPrime[q]]; p, {n, 65}]
  • PARI
    a(n) = {my(pn=prime(n)); my(p=2); forprime(q=3,, if ((p+q) % pn, p = q, break);); p;} \\ Michel Marcus, Jul 05 2017