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.

This page as a plain text file.
%I A188903 #19 Feb 20 2023 07:51:34
%S A188903 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,
%T A188903 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,
%U A188903 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
%N A188903 a(n) is the least power of 2 such that 2n+1 - a(n) is prime, or 0 if no such prime exists.
%C A188903 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.
%C A188903 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, ...}.
%D A188903 David Wells, Prime Numbers: The Most Mysterious Figures In Math, John Wiley & Sons, 2005, p. 175-176.
%H A188903 Carlos Rivera, <a href="http://www.primepuzzles.net/puzzles/puzz_219.htm">Puzzle 219, Polignac numbers</a>, The Prime Puzzles and Problems Connection.
%e A188903 a(1) = 1 because 2*1 + 1 = 3 = 1 + 2 ;
%e A188903 a(2) = 2 because 2*2 + 1 = 5 = 2 + 3 ;
%e A188903 a(3) = 2 because 2*3 + 1 = 7 = 2 + 5 ;
%e A188903 a(63) = 0 ; a(74) = 0 ; a(125) = 0, ....
%p A188903 with(numtheory):for n from 1 to 126 do:x:=2*n+1:id:=0:for k from 0 to 50 while(id=0)
%p A188903   do: for q from 1 to 100 while(id=0) do: p:=ithprime(q): y:=2^k+p:if y=x then
%p A188903   id:=1:printf(`%d, `,2^k):else fi:od:od:if id=0 then printf(`%d, `,0):else fi:od:
%t A188903 Table[d = 2*n + 1; k = 1; While[k < d && ! PrimeQ[d - k], k = 2*k]; If[k < d, k, 0], {n, 0, 126}]
%o A188903 (Sage)
%o A188903 def A188903(n):
%o A188903     return next((2**k for k in (0..floor(log(2*n+1,2))) if is_prime(2*n+1-2**k)), 0)
%o A188903 # _D. S. McNeil_, Apr 14 2011
%Y A188903 Cf. A065381 (primes not of the form p + 2^k, p prime and k >= 0), A156695.
%K A188903 nonn
%O A188903 0,3
%A A188903 _Michel Lagneau_, Apr 13 2011