cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A188903 a(n) is the least power of 2 such that 2n+1 - a(n) is prime, or 0 if no such prime exists.

Original entry on oeis.org

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

Views

Author

Michel Lagneau, Apr 13 2011

Keywords

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.
The sequence A006285 gives the odd numbers for which the conjecture fails. Hence, a(n) = 0 for n = (A006285(k)-1)/2 = {0, 63, 74, 125, 165, 168, 186, ...}.

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.

Crossrefs

Cf. A065381 (primes not of the form p + 2^k, p prime and k >= 0), A156695.

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