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; internal format)
OFFSET

1,5

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: A002332 A002102 A047655 * A078882 A202252 A120919

Adjacent sequences:  A078682 A078683 A078684 * A078686 A078687 A078688

KEYWORD

nonn

AUTHOR

Benoit Cloitre (benoit7848c(AT)orange.fr), Dec 17 2002

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
Recent Additions | More pages | Superseeker | Maintained by The OEIS Foundation Inc.

Content is available under The OEIS End-User License Agreement .

Last modified February 17 00:09 EST 2012. Contains 205978 sequences.