%I #100 Mar 31 2022 13:24:20
%S 1,5,9,15,75,165,16065,137445,540645,2222535,374958045,18327149295
%N 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 All terms are odd. If the number j is allowed to be 0, then a(1) = 4. - _Chai Wah Wu_, Mar 24 2022
%e 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 f:= proc(n) local t,s:
%p nops(select(t -> isprime(n+2^t) and isprime(n-2^t), [$1..ilog2(n)]));
%p end proc:
%p V:= Array(0..10): count:= 0:
%p for n from 1 while count < 11 do
%p v:= f(n); if V[v] = 0 then V[v] := n; count:= count+1 fi
%p od:
%p convert(V,list);
%o (Python)
%o from itertools import count
%o from sympy import isprime
%o def A351826(n):
%o for k in count(1,2):
%o c = 0
%o for j in count(1):
%o if k-2**j < 2:
%o break
%o if isprime(k-2**j) and isprime(k+2**j):
%o c += 1
%o if c > n:
%o break
%o if c == n: return k # _Chai Wah Wu_, Mar 24 2022
%K nonn,more
%O 0,2
%A _J. M. Bergot_ and _Robert Israel_, Mar 24 2022
%E a(11) from _Jean-Marc Rebert_, Mar 31 2022
|