login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A051650 Lonely numbers: distance to closest prime sets a new record. 18
0, 23, 53, 120, 211, 1340, 1341, 1342, 1343, 1344, 2179, 3967, 15704, 15705, 16033, 19634, 19635, 24281, 31428, 31429, 31430, 31431, 31432, 31433, 38501, 58831, 155964, 203713, 206699, 370310, 370311, 370312, 370313, 370314, 370315, 370316 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,2

LINKS

Charles R Greathouse IV and Giovanni Resta, Table of n, a(n) for n = 0..211 (terms < 10^14, first 156 terms from Charles R Greathouse IV)

EXAMPLE

23 is 4 units away from the closest prime (not including itself), so 23 is in the sequence.

MAPLE

P:=proc(q) local a, b, c, n; a:=0; c:=[]; for n from 23 to q do

b:=min(n-prevprime(n), nextprime(n)-n); if b>a then a:=b; c:=[op(c), n];

fi; od; print(0, op(c)); end:  P(370316); # Paolo P. Lava, Jul 05 2018

MATHEMATICA

d[0] = 2; d[k_] := Min[k - NextPrime[k, -1], NextPrime[k] - k]; a[0] = 0; a[n_] := a[n] = (k = a[n-1] + 1; record = d[a[n-1]]; While[d[k] <= record, k++]; k); Table[a[n], {n, 0, 35}] (* Jean-Fran├žois Alcover, Jan 16 2012 *)

PROG

(PARI) print1(0); w=2; p=2; q=3; forprime(r=5, 1e9, if(p+w+w<q, for(t=p+w+1, (q+p)\2, print1(", "t)); w=(q-p)\2); t=min(q-p, r-q); if(t>w, w=t; print1(", "q)); p=q; q=r) \\ Charles R Greathouse IV, Jan 16 2012

CROSSREFS

Related sequences: A023186-A023188, A046929-A046931, A051650, A051652, A051697-A051702, A051728-A051730.

Distances are in A051730.

Sequence in context: A128473 A132235 A277993 * A049438 A078854 A078959

Adjacent sequences:  A051647 A051648 A051649 * A051651 A051652 A051653

KEYWORD

nonn,nice

AUTHOR

N. J. A. Sloane

EXTENSIONS

More terms from James A. Sellers, Dec 23 1999 and from Jud McCranie, Jun 16 2000

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified February 27 15:59 EST 2020. Contains 332307 sequences. (Running on oeis4.)