login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A078685 Minimum value of |prime(n) - 2^x|. 1
0, 1, 1, 1, 3, 3, 1, 3, 7, 3, 1, 5, 9, 11, 15, 11, 5, 3, 3, 7, 9, 15, 19, 25, 31, 27, 25, 21, 19, 15, 1, 3, 9, 11, 21, 23, 29, 35, 39, 45, 51, 53, 63, 63, 59, 57, 45, 33, 29, 27, 23, 17, 15, 5, 1, 7, 13, 15, 21, 25, 27, 37, 51, 55, 57, 61, 75, 81, 91, 93, 97, 103, 111, 117, 123, 127 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,5

LINKS

Table of n, a(n) for n=1..76.

MAPLE

A078685 := proc(n) local p, a, x, r ; p := ithprime(n) ; a := p ; for x from 0 do r := p-2^x ; if r < -p then return a ; fi ; r := abs(r) ; if r < a then a := r ; end if; end do: a ; end proc:

seq(A078685(n), n=1..80) ; # R. J. Mathar, Apr 08 2011

PROG

(Sage)

def A078685(n):

....p = nth_prime(n)

....x0 = floor(log(p, 2))

....return min(abs(p-2**x) for x in (x0, x0+1))

## D. S. McNeil, Apr 08 2011

CROSSREFS

Sequence in context: A002102 A209334 A047655 * A078882 A262220 A325254

Adjacent sequences:  A078682 A078683 A078684 * A078686 A078687 A078688

KEYWORD

nonn

AUTHOR

Benoit Cloitre, Dec 17 2002

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 June 17 15:22 EDT 2019. Contains 324185 sequences. (Running on oeis4.)