OFFSET
0,3
COMMENTS
The second Polignac's Conjecture states that every odd positive integer is the sum of a prime and a power of two. This conjecture was proved false, and the smallest counterexample is 127 because subtracting powers of 2 from 127 produces the composite numbers 126, 123, 119, 111, 95, and 63.
REFERENCES
David Wells, Prime Numbers: The Most Mysterious Figures In Math, John Wiley & Sons, 2005, p. 175-176.
LINKS
Carlos Rivera, Puzzle 219, Polignac numbers, The Prime Puzzles and Problems Connection.
EXAMPLE
a(1) = 1 because 2*1 + 1 = 3 = 1 + 2 ;
a(2) = 2 because 2*2 + 1 = 5 = 2 + 3 ;
a(3) = 2 because 2*3 + 1 = 7 = 2 + 5 ;
a(63) = 0 ; a(74) = 0 ; a(125) = 0, ....
MAPLE
with(numtheory):for n from 1 to 126 do:x:=2*n+1:id:=0:for k from 0 to 50 while(id=0)
do: for q from 1 to 100 while(id=0) do: p:=ithprime(q): y:=2^k+p:if y=x then
id:=1:printf(`%d, `, 2^k):else fi:od:od:if id=0 then printf(`%d, `, 0):else fi:od:
MATHEMATICA
Table[d = 2*n + 1; k = 1; While[k < d && ! PrimeQ[d - k], k = 2*k]; If[k < d, k, 0], {n, 0, 126}]
PROG
(Sage)
def A188903(n):
return next((2**k for k in (0..floor(log(2*n+1, 2))) if is_prime(2*n+1-2**k)), 0)
# D. S. McNeil, Apr 14 2011
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Lagneau, Apr 13 2011
STATUS
approved