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.

A050200 Let p = prime(n). Then a(n) = p + (next prime >= p+1) + (next prime >= p+3).

Original entry on oeis.org

10, 15, 23, 29, 41, 47, 59, 65, 81, 97, 105, 119, 131, 137, 153, 171, 187, 195, 209, 223, 231, 245, 261, 283, 299, 311, 317, 329, 335, 367, 389, 405, 425, 437, 457, 465, 483, 497, 513, 531, 551, 563, 581, 587, 607, 621, 657, 677, 689, 695, 711, 731, 743, 765
Offset: 0

Views

Author

Cino Hilliard, May 08 2003

Keywords

Comments

The occurrence of multiples of 3 in the sequence appears to converge to about 0.44.

Crossrefs

Cf. A034962.

Programs

  • Mathematica
    nextprim[n_] := Block[{k = n}, While[ ! PrimeQ[k], k++ ]; k]; f[n_] := (x = Prime[n]; nextprim[x] + nextprim[x + 1] + nextprim[x + 3]); Table[ f[n], {n, 54}] (* Robert G. Wilson v, Feb 12 2005 *)
    np[n_]:=Module[{pr=Prime[n]},pr+NextPrime[pr+1]+NextPrime[pr+3]]; Join[ {10}, Array[ np,60,2]] (* Harvey P. Dale, Mar 04 2015 *)
  • PARI
    sumprime3(n) = { c1=0; c2=0; forprime(x=2,n, s = nextprime(x)+nextprime(x+1)+nextprime(x+3); c1++; if(s%3==0,c2++); print1(s" "); ); print(); print(c2/c1+.0) }

Extensions

Definition corrected by Zak Seidov, Robert G. Wilson v and Ralf Stephan, Feb 10 2005