# Greetings from The On-Line Encyclopedia of Integer Sequences! http://oeis.org/ Search: id:a351826 Showing 1-1 of 1 %I A351826 #100 Mar 31 2022 13:24:20 %S A351826 1,5,9,15,75,165,16065,137445,540645,2222535,374958045,18327149295 %N A351826 a(n) is the least k such that there are exactly n positive numbers j such that k - 2^j and k + 2^j are both prime. %C A351826 All terms are odd. If the number j is allowed to be 0, then a(1) = 4. - _Chai Wah Wu_, Mar 24 2022 %e A351826 a(4) = 75 because 75 +/- 2^2 = 79 and 71, 75 +/- 2^3 = 83 and 67, 75 +/- 2^5 = 107 and 43, and 75 +/- 2^6 = 139 and 11 are all prime, and 75 is the least number for which there are exactly 4 such powers of 2. %p A351826 f:= proc(n) local t,s: %p A351826 nops(select(t -> isprime(n+2^t) and isprime(n-2^t), [$1..ilog2(n)])); %p A351826 end proc: %p A351826 V:= Array(0..10): count:= 0: %p A351826 for n from 1 while count < 11 do %p A351826 v:= f(n); if V[v] = 0 then V[v] := n; count:= count+1 fi %p A351826 od: %p A351826 convert(V,list); %o A351826 (Python) %o A351826 from itertools import count %o A351826 from sympy import isprime %o A351826 def A351826(n): %o A351826 for k in count(1,2): %o A351826 c = 0 %o A351826 for j in count(1): %o A351826 if k-2**j < 2: %o A351826 break %o A351826 if isprime(k-2**j) and isprime(k+2**j): %o A351826 c += 1 %o A351826 if c > n: %o A351826 break %o A351826 if c == n: return k # _Chai Wah Wu_, Mar 24 2022 %K A351826 nonn,more %O A351826 0,2 %A A351826 _J. M. Bergot_ and _Robert Israel_, Mar 24 2022 %E A351826 a(11) from _Jean-Marc Rebert_, Mar 31 2022 # Content is available under The OEIS End-User License Agreement: http://oeis.org/LICENSE