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.

A089795 Smallest prime(k) such that prime(k)-prime(k-1) is equal to prime(k+n)-prime(k).

Original entry on oeis.org

5, 37, 1009, 4327, 6197, 6947, 43391, 31469, 1324567, 678719, 6655531, 1895479, 6085103, 21500429, 93685619, 523000399, 20388727, 709208557
Offset: 1

Views

Author

Robert G. Wilson v, Nov 11 2003

Keywords

Comments

Cf. A089344.

Examples

			a(4) = 4327, the previous prime is 4297, 4327-4297 = 30, the next four primes are 4337, 4339, 4349 and 4357. 4357-4327 = 30.
		

Programs

  • Mathematica
    f[n_] := Block[{k = n + 1}, While[ 2Prime[k] != Prime[k - 1] + Prime[k + n], k++ ]; Prime[k]]; Table[ f[n], {n, 18}]
  • PARI
    a(n)=local(k=1);if(n<1,0,until(prime(k)-prime(k-1)==prime(k+n)-prime(k),k++);prime(k)) /* Michael Somos, Feb 01 2004 */