login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A053543 Distance to closest prime in sequence of composites. 0

%I #6 Aug 31 2015 12:42:10

%S 1,1,1,2,1,1,1,2,1,1,1,2,1,1,2,3,2,1,1,1,2,3,2,1,1,2,1,1,1,2,1,1,2,3,

%T 2,1,1,2,3,2,1,1,1,2,3,2,1,1,2,1,1,1,2,3,2,1,1,2,1,1,2,3,2,1,1,2,3,4,

%U 3,2,1,1,2,1,1,1,2,1,1,1,2,1,1,2,3,4,5,6,7,6,5,4,3,2,1,1,2,1,1,2,3,2,1,1,1

%N Distance to closest prime in sequence of composites.

%F Beginning at 2, list consecutive numbers. Measure distance of each composite to nearest prime.

%e Fourth composite number is 9; distance to nearest prime, 7 or 11, is 2, so a(4) = 2.

%t Min[NextPrime[#]-#,#-NextPrime[#,-1]]&/@Select[Range[140],CompositeQ] (* _Harvey P. Dale_, Aug 31 2015 *)

%K easy,nonn

%O 1,4

%A _Enoch Haga_, Jan 16 2000

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 22:17 EDT 2024. Contains 371964 sequences. (Running on oeis4.)