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.

A123128 Add n to the n-th difference between consecutive primes.

Original entry on oeis.org

2, 4, 5, 8, 7, 10, 9, 12, 15, 12, 17, 16, 15, 18, 21, 22, 19, 24, 23, 22, 27, 26, 29, 32, 29, 28, 31, 30, 33, 44, 35, 38, 35, 44, 37, 42, 43, 42, 45, 46, 43, 52, 45, 48, 47, 58, 59, 52, 51, 54, 57, 54, 63, 60, 61, 62, 59, 64, 63, 62, 71, 76, 67, 66, 69, 80, 73, 78, 71, 74, 77
Offset: 1

Views

Author

Herman Jamke (hermanjamke(AT)fastmail.fm), Sep 30 2006

Keywords

Crossrefs

Programs

  • Magma
    [n + NthPrime(n+1) - NthPrime(n): n in [1..80]]; // G. C. Greubel, Aug 03 2021
    
  • Mathematica
    With[{nn=80},Total/@Thread[{Differences[Prime[Range[nn]]],Range[nn-1]}]] (* Harvey P. Dale, Jun 02 2014 *)
  • PARI
    for(n=1,100,print1(prime(n+1)-prime(n)+n,","))
    
  • Sage
    [n + nth_prime(n+1) - nth_prime(n) for n in (1..80)] # G. C. Greubel, Aug 03 2021

Formula

a(n) = n + (prime(n+1) - prime(n)) = n + A001223(n).
From G. C. Greubel, Aug 03 2021: (Start)
a(n) = A014690(n) - prime(n) = A095116(n+1) - prime(n).
a(n) = prime(n+1) - A014689(n). (End)