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!)
A212595 Let f(n) = 2n-7. Difference between f(n) and the nearest prime < f(n). 1
2, 2, 4, 2, 2, 4, 2, 4, 6, 2, 2, 4, 6, 2, 4, 2, 2, 4, 2, 4, 6, 2, 4, 6, 2, 2, 4, 6, 2, 4, 2, 2, 4, 6, 2, 4, 2, 4, 6, 2, 4, 6, 8, 2, 4, 2, 2, 4, 2, 2, 4, 2, 4, 6, 8, 10, 12, 14, 2, 4, 2, 4, 6, 2, 2, 4, 6, 8, 10, 2, 2, 4, 6, 2, 4, 6, 2, 4, 2, 4, 6, 2, 4, 6, 2, 2 (list; graph; refs; listen; history; text; internal format)
OFFSET
10,1
COMMENTS
It's known that there is always a prime between n and 2n - 7 for all n >= 10.
LINKS
Peter Vandendriessche and Hojoo Lee, Problems in elementary number theory, Problem E37
EXAMPLE
a(12) = 4 because 2*12-7 = 17, and the nearest prime p < 17 such that 12 < p < 17 is p = 13. Hence a(12) = 17 - 13 = 4.
MAPLE
with(numtheory):for n from 10 to 100 do:x:=2*n-7:i:=0:for p from x-1 by -1 to n+1 while(i=0) do:if type(p, prime)=true then i:=1:printf(`%d, `, x-p):else fi:od:od:
MATHEMATICA
Array[# - Prime@ PrimePi[# - 1] &[2 # - 7] &, 86, 10] (* Michael De Vlieger, Oct 17 2019 *)
CROSSREFS
Sequence in context: A069177 A077659 A367953 * A087692 A093621 A242734
KEYWORD
nonn
AUTHOR
Michel Lagneau, May 22 2012
STATUS
approved

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 25 07:41 EDT 2024. Contains 371964 sequences. (Running on oeis4.)