login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Least positive integer k < n such that n + k + 2^k is prime, or 0 if such an integer k does not exist.
5

%I #47 Aug 05 2019 09:26:29

%S 0,1,0,1,2,3,2,1,4,1,2,3,2,1,10,1,2,3,6,1,4,5,2,5,2,1,4,1,8,3,2,3,4,1,

%T 2,3,2,1,4,1,2,3,6,1,12,5,2,3,8,1,4,5,2,11,2,1,6,1,4,3,2,3,4,1,2,5,2,

%U 1,4,1,22,3,2,57,10,1,2,3,6,1,4,11,2,11,8,1,4,7,4,3,2,3,4,1,2,3,2,1,16,1

%N Least positive integer k < n such that n + k + 2^k is prime, or 0 if such an integer k does not exist.

%C This was motivated by A231201 and A231557.

%C Conjecture: a(n) > 0 for all n > 3. We have verified this for n up to 2*10^6; for example, we find the following relatively large values of a(n): a(65958) = 37055, a(299591) = 51116, a(295975) = 13128, a(657671) = 25724, a(797083) = 44940, a(1278071) = 24146, a(1299037) = 34502, a(1351668) = 25121, a(1607237) = 34606, a(1710792) = 11187, a(1712889) = 18438.

%C I conjecture the opposite. In particular I expect that a(n) = 0 for infinitely many values of n. - _Charles R Greathouse IV_, Nov 13 2013

%H Zhi-Wei Sun, <a href="/A231725/b231725.txt">Table of n, a(n) for n = 1..10000</a>

%H Z.-W. Sun, <a href="http://arxiv.org/abs/1312.1166">On a^n+ bn modulo m</a>, arXiv preprint arXiv:1312.1166 [math.NT], 2013-2014.

%e a(3) = 0 since 3 + 1 + 2^1 = 6 and 3 + 2 + 2^2 = 9 are both composite.

%e a(5) = 2 since 5 + 1 + 2^1 = 8 is not prime, but 5 + 2 + 2^2 = 11 is prime.

%t Do[Do[If[PrimeQ[n+k+2^k],Print[n," ",k];Goto[aa]],{k,1,n-1}];

%t Print[n," ",0];Label[aa];Continue,{n,1,100}]

%o (PARI) a(n)=for(k=1,n-1,if(ispseudoprime(n+k+2^k),return(k)));0 \\ _Charles R Greathouse IV_, Nov 13 2013

%Y Cf. A000040, A000079, A231201, A231516, A231557, A231561, A231631, A231776.

%K nonn

%O 1,5

%A _Zhi-Wei Sun_, Nov 12 2013