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.

A085909 Smallest prime p>prime(n) such that p+prime(n+1)-prime(n) is the next prime after p; or a(n)=0 if no such prime exists.

Original entry on oeis.org

0, 5, 11, 13, 17, 19, 29, 37, 31, 41, 47, 43, 59, 67, 53, 61, 71, 73, 79, 101, 83, 97, 131, 359, 103, 107, 109, 137, 127, 293, 163, 151, 149, 181, 179, 157, 167, 193, 173, 233, 191, 241, 197, 223, 227, 211, 467, 229, 239, 277, 251, 269, 283, 257, 263, 271, 281
Offset: 1

Views

Author

Amarnath Murthy, Jul 09 2003

Keywords

Comments

A001223(n) = A001223(A049084(a(n))); a(A001359(n)) = A001359(n+1); conjecture: a(n) > 0 for n > 1 (implies the twin prime conjecture). - Reinhard Zumkeller, Jan 26 2004
For n > 1, a(n) >= prime(n+1) and a(n) = prime(n+1) if prime(n+1) is a balanced prime (A006562). - Zak Seidov, Jun 03 2015

Crossrefs

Programs

  • MATLAB
    P = primes(5000); A = zeros(1, length(P));D = P(2:end) - P(1:(length(P) - 1)); for i = 2:2:(max(D));f = find(D == i); A(f(1:(length(f) - 1))) = P(f(2:end));end;A(2:100) % David Wasserman, Jan 26 2004
  • Mathematica
    a[1] = 0; a[n_] := For[p = Prime[n+1]; d = p - Prime[n], True, p = q, q = NextPrime[p]; If[d == q - p, Return[p]]]; (* Jean-François Alcover, Feb 24 2015 *)

Extensions

More terms from Reinhard Zumkeller and David Wasserman, Jan 26 2004
Edited by N. J. A. Sloane, Oct 21 2008 at the suggestion of R. J. Mathar