OFFSET
1,1
COMMENTS
REFERENCES
Paul Erdős and Janos Suranyi, Topics in the theory of numbers, Springer, 2003.
LINKS
Dmitry Petukhov, Table of n, a(n) for n = 1..56 (first 40 terms from Ken Takusagawa, terms 41..52 from Giovanni Resta)
EXAMPLE
The nearest prime to 23 is 4 units away, larger than any previous prime, so 23 is in the sequence.
The prime a(4) = A120937(3) = 53 is at distance 2*3 = 6 from its neighbors {47, 59}. The prime a(5) = A120937(4) = A120937(5) = A120937(6) = 211 is at distance 2*6 = 12 from its neighbors {199, 223}. Sequence A120937 requires the terms to have 2 neighbors, therefore its first term is 3 and not 2. - M. F. Hasler, Dec 28 2015
MATHEMATICA
p = 0; q = 2; i = 0; Do[r = NextPrime[q]; m = Min[r - q, q - p]; If[m > i, Print[q]; i = m]; p = q; q = r, {n, 1, 152382000}]
Join[{2}, DeleteDuplicates[{#[[2]], Min[Differences[#]]}&/@Partition[Prime[ Range[ 2, 10^6]], 3, 1], GreaterEqual[ #1[[2]], #2[[2]]]&][[;; , 1]]] (* The program generates the first 20 terms of the sequence. *) (* Harvey P. Dale, Aug 31 2023 *)
CROSSREFS
KEYWORD
nonn,nice
AUTHOR
EXTENSIONS
More terms from Jud McCranie, Jun 16 2000
More terms from T. D. Noe, Jul 21 2006
STATUS
approved