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.

A073131 a(n) = prime(prime(n+1)) - prime(prime(n)).

Original entry on oeis.org

2, 6, 6, 14, 10, 18, 8, 16, 26, 18, 30, 22, 12, 20, 30, 36, 6, 48, 22, 14, 34, 30, 30, 48, 38, 16, 24, 12, 18, 92, 30, 34, 24, 62, 18, 42, 48, 24, 40, 32, 24, 66, 18, 30, 16, 80, 112, 24, 14, 24, 28, 24, 74, 24, 48, 54, 18, 46, 36, 24, 66, 114, 36, 18, 18, 122, 48, 72, 10, 30
Offset: 1

Views

Author

Labos Elemer, Jul 16 2002

Keywords

Comments

The first differences of A006450. Conjecture: a(n) < log^3 A006450(n) for sufficiently large n. - Thomas Ordowski, Mar 22 2015

Examples

			n=10, prime(11) - prime(10) = 31 - 29 = 2, a(10) = prime(31) - prime(29) = 127 - 109 = 18.
		

Crossrefs

Programs

  • Magma
    [NthPrime(NthPrime(n+1)) - NthPrime(NthPrime(n)): n in [1..80]]; // G. C. Greubel, Oct 20 2019
    
  • Maple
    seq(ithprime(ithprime(n+1))-ithprime(ithprime(n)), n = 1..80);  # G. C. Greubel, Oct 20 2019
  • Mathematica
    Table[Prime[Prime[n+1]]-Prime[Prime[n]], {n, 80}]
  • PARI
    a(n) = prime(prime(n+1)) - prime(prime(n)); \\ Michel Marcus, Jul 01 2016
    
  • PARI
    a(n,p=prime(n))=my(q=nextprime(p+1),r=prime(p),s,total); for(i=1,q-p, s=nextprime(r+1); total+=s-r; r=s); total; \\ Charles R Greathouse IV, Dec 30 2018
    
  • Sage
    [nth_prime(nth_prime(n+1)) - nth_prime(nth_prime(n)) for n in (1..80)] # G. C. Greubel, Oct 20 2019

Formula

a(n) = A006450(n+1) - A006450(n). - Thomas Ordowski, Mar 22 2015
G.f.: (Sum_{ k>=1 } x^pi(pi(k))) -2, with pi(k) the prime counting function. - Benedict W. J. Irwin, Jun 13 2016