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.

Showing 1-2 of 2 results.

A066496 a(n) = least solution k of f(k) = f(k-1) + ... + f(k-n), where f(m) = prime(m+1)-prime(m) and prime(m) denotes the m-th prime, if k exists; 0 otherwise.

Original entry on oeis.org

3, 4, 114, 852, 1648, 1847, 2500, 22765, 54954, 59930, 47350, 971579, 2183012, 1945709, 14424271, 19139070, 19517159, 122815056, 318016298, 72732221, 575945350, 1020650071, 3009991871, 3411065961, 9193759213, 847932178, 310400972174, 221060379834, 125367239529, 426824249940
Offset: 1

Views

Author

Joseph L. Pe, Jan 03 2002

Keywords

Comments

Equivalently, a(n) is the least k such that prime(k+1) - prime(k) = prime(k) - prime(k-n). - Giovanni Resta, Apr 03 2017

Examples

			3 is the smallest solution of f(k) = f(k-1); so a(1) = 3. 4 is the smallest solution of f(k) = f(k-1)+f(k-2); so a(2) = 4. 114 is the smallest solution of f(k) = f(k-1)+f(k-2)+f(k-3); so a(3) = 114.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Block[{k=n+1}, While[2 Prime[k] != Prime[k + 1] + Prime[k - n], k++]; k]; Array[a, 8] (* Giovanni Resta, Apr 03 2017 *)

Formula

a(n) = A000720(A089344(n)). - Giovanni Resta, Apr 04 2017

Extensions

a(6)-a(30) from Giovanni Resta, Apr 04 2017
Definition corrected by David A. Corneth, Apr 04 2017

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 */
Showing 1-2 of 2 results.