A023187 Distances of increasingly lonely primes to nearest prime.
1, 2, 4, 6, 12, 14, 18, 20, 24, 30, 40, 42, 44, 48, 54, 62, 72, 76, 96, 98, 108, 116, 124, 136, 156, 160, 162, 168, 174, 176, 178, 180, 186, 194, 210, 214, 222, 242, 244, 246, 250, 258, 268, 284, 300, 324, 328, 340, 348, 352, 390, 396, 420, 432, 452, 480
Offset: 1
Keywords
Examples
The nearest prime to 23 is 4 units away, larger than any previous prime, so 4 is in the sequence.
Crossrefs
Programs
-
Mathematica
t={}; max=p=0; q=2; Do[r=NextPrime[q]; If[(min=Min[q-p,r-q])>max, max=min; AppendTo[t,max]]; p=q; q=r, {n,828000}]; t (* Jayanta Basu, May 18 2013 *)
Extensions
More terms from Jud McCranie, Jun 16 2000
More terms from T. D. Noe, Jul 21 2006
More terms from Dmitry Petukhov, Oct 03 2015
Comments