A188903 a(n) is the least power of 2 such that 2n+1 - a(n) is prime, or 0 if no such prime exists.
0, 1, 2, 2, 2, 4, 2, 2, 4, 2, 2, 4, 2, 4, 16, 2, 2, 4, 8, 2, 4, 2, 2, 4, 2, 4, 16, 2, 4, 16, 2, 2, 4, 8, 2, 4, 2, 2, 4, 8, 2, 4, 2, 4, 16, 2, 4, 16, 8, 2, 4, 2, 2, 4, 2, 2, 4, 2, 4, 16, 8, 16, 16, 0, 2, 4, 2, 4, 64, 2, 2, 4, 8, 8, 0, 2, 2, 4, 8, 2, 4, 32, 2, 4, 2, 4, 16, 2, 4, 16, 2, 2, 4, 8, 8, 64, 2, 2, 4, 2, 2, 4, 8, 8, 16, 32, 2, 4, 128, 8, 64, 32, 2, 4, 2, 2, 4, 2, 4, 16, 2, 2, 4, 8, 8, 0, 2
Offset: 0
Keywords
Examples
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, ....
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.
Programs
-
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}]
-
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
Comments