login
A068843
Smallest prime in the first occurrence of a nondecreasing difference for a set of exactly n successive primes.
2
37, 11, 17, 2, 1091, 2897, 13451, 448363, 7407287, 34400141, 255030533, 6564959561, 45605475961, 121054164221, 2552790756469
OFFSET
1,1
COMMENTS
This is the same as asking for the smallest prime in the first occurrence of a nonnegative second difference for a set of n successive primes.
LINKS
EXAMPLE
The prime 2 starts the first run of exactly 4 nondecreasing gaps (1, 2, 2, 4) between the 5 primes (2, 3, 5, 7, 11). (The next gap would be of 2, smaller than 4.) Therefore a(4) = 2.
The prime 11 starts the first run of exactly 2 nondecreasing gaps (2, 4) between the 3 primes (11, 13, 17). (The preceding gap is 4 > 2 and the next gap would be 2 < 4.) Therefore a(2) = 11. The sequences of primes (2, 3, 5) as well as (5, 7, 11) are part of a longer run of nondecreasing gaps and are therefore not considered for the case n = 2.
The prime 17 starts the first run of exactly 3 nondecreasing gaps (2, 4, 4) between the 4 primes (17, 19, 23, 29). (The preceding gap is 4 > 2 and the next gap would be 2 < 4.) Therefore a(3) = 17. Again, primes which are part of a longer run cannot be considered.
The prime 37 starts the first run of exactly 1 nondecreasing gap (4) between the primes 37 and 41. (The preceding gap is 6 > 4 and the next gap would be 2 < 4.) Therefore a(1) = 37.
MATHEMATICA
(* used to find a(11) *) k = 0; While[p = Select[ Range[ k*10^6, (k + 1)*10^6 + 10^4], PrimeQ[ # ] & ]; l = Length[p]; d1 = Take[p, 1 - l] - Take[p, l - 1]; d2 = Take[d1, 2 - l] - Take[d1, l - 2]; s = Sign[ Sign[d2] + 1]; q = StringPosition[ ToString[s], StringDrop[ StringDrop[ ToString[ Table[1, {10}]], 1], -1]]; q == {}, k++ ]; p[[ (q[[1, 1]] + 1)/3 ]]
PROG
(PARI) A068843(n, c=n+1, g, o=2, P=2)={forprime(p=3, , c--; g>(g=-o+o=p)||next; c||break; c=n; P=p-g); P} \\ M. F. Hasler, May 16 2017
CROSSREFS
Sequence in context: A107812 A254324 A356745 * A284497 A033357 A093860
KEYWORD
nonn,base,hard,more
AUTHOR
Amarnath Murthy, Mar 10 2002
EXTENSIONS
More terms from Robert G. Wilson v, May 10 2002 and Dec 08 2002, who finds that a(12) > 2.7*10^9
a(12) = 6564959561 from Zak Seidov and other edits by M. F. Hasler, May 16 2017
a(13)-a(15) from Giovanni Resta, May 18 2017
STATUS
approved