Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A051730
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
A051730 Distance from A051650(n) to nearest prime. +0
18
2, 4, 6, 7, 12, 13, 14, 15, 16, 17, 18, 20, 21, 22, 24, 25, 26, 30, 31, 32, 33, 34, 35, 36, 40, 42, 43, 44, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 96, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109 (list; graph; listen)
OFFSET

0,1

EXAMPLE

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

PROGRAM

(UBASIC) [10] C#=pack(3, 5):R=2:N=4:print 2; [20] if N>member(C#, 2) then C#=pack(member( C#, 2)):C#=C#+nxtprm(member(C#, 1)) [30] Prv=member(C#, 1):Nxt=member(C#, 2) [40] if Nxt=N then Nxt=nxtprm(N) [50] if (N-Prv)>=(Nxt-N) then P=Nxt-N else P=N-Prv [60] if P>R then print P; :R=P [70] N+=1 :goto 20

CROSSREFS

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

Sequence in context: A070119 A070125 A029501 this_sequence A070317 A138398 A086781

Adjacent sequences: A051727 A051728 A051729 this_sequence A051731 A051732 A051733

KEYWORD

nonn,easy,nice

AUTHOR

N. J. A. Sloane (njas(AT)research.att.com).

EXTENSIONS

More terms from James A. Sellers (sellersj(AT)math.psu.edu), Dec 23 1999 and from Jud McCranie (j.mccranie(AT)comcast.net), Jun 16 2000. Further terms from Naohiro Nomoto (6284968128(AT)geocities.co.jp), Jun 21 2001

page 1

Search completed in 0.002 seconds

Lookup | Welcome | Find friends | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
More pages | Superseeker | Maintained by N. J. A. Sloane (njas@research.att.com)

Last modified November 29 12:46 EST 2009. Contains 167659 sequences.


AT&T Labs Research