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.

A214123 Smallest positive k such that n+k(n-1) is prime.

Original entry on oeis.org

1, 1, 1, 2, 1, 1, 3, 1, 1, 2, 1, 2, 3, 1, 1, 5, 5, 1, 9, 1, 1, 2, 1, 2, 3, 1, 3, 3, 1, 1, 9, 2, 1, 2, 1, 1, 3, 4, 1, 5, 1, 2, 3, 1, 3, 2, 5, 1, 3, 1, 1, 2, 1, 1, 5, 1, 3, 3, 11, 2, 5, 4, 1, 2, 1, 2, 3, 1, 1, 2, 7, 5, 3, 1, 1, 2, 5, 1, 3, 2, 1, 8, 1, 3, 11, 1, 3, 3, 1, 1, 5, 2, 3, 2, 1, 1, 3, 1, 1, 3, 5, 2, 5, 2, 1, 6, 5, 3, 9, 2, 1, 2, 1, 1, 3, 1, 7, 5, 1, 1, 5, 2, 5, 2, 1, 2, 3, 1, 7, 3, 1, 2, 11, 1, 1, 2, 5, 1, 3, 1, 1, 3, 5, 2, 9, 1, 5, 3
Offset: 2

Views

Author

Carl R. White, Jul 04 2012

Keywords

Comments

Given n fenceposts, what is the minimum (but greater than zero) number of new posts which can be inserted between each consecutive pair of original posts to obtain a prime number of total posts?
Where the minimum is allowed to be zero, substitute a(n) = 0 for prime n.
a(n) is 1 when 2n-1 is prime, which is equivalent to a((p+1)/2)=1 for prime p > 2, therefore there are an infinite number of pairs of consecutive 1s in the sequence if the twin prime conjecture is true.

Examples

			For n = 5, we have fenceposts like so: ||||| . To insert 1 post between each pair of original posts would leave us with 9 posts: |;|;|;|;|, which is not prime. Inserting two: |;;|;;|;;|;;| gives 13 posts. This is prime so a(5) = 2.
		

Crossrefs

Programs

  • Mathematica
    spk[n_]:=Module[{k=1},While[!PrimeQ[n+k(n-1)],k++];k]; Array[spk,150,2] (* Harvey P. Dale, May 04 2013 *)

A214124 Indices of consecutive maxima in A214123.

Original entry on oeis.org

2, 5, 8, 17, 20, 60, 160, 228, 318, 362, 522, 1638, 1692, 1998, 2054, 3834, 5208, 21210, 62810, 152352, 170168, 424784
Offset: 1

Views

Author

Carl R. White, Jul 04 2012

Keywords

Comments

n where A214123(n) has a larger value than any previous value in that sequence, the corresponding values can be found in A214125.
It appears that for the n in this sequence, A214123(n) is O(log^2(n)).

Crossrefs

Showing 1-2 of 2 results.