A227230
Numbers k such that 3*2^k + {5,7} are twin primes.
Original entry on oeis.org
1, 2, 3, 5, 6, 19, 22
Offset: 1
-
Reap[Do[If[PrimeQ[a=3*2^n+5]&&PrimeQ[a+2],Sow[n]],{n,150}]][[2,1]]
-
for(k = 1,10^4, if(ispseudoprime(a = 3*2^k + 5)&&ispseudoprime (a + 2), print1(k",")))
A386857
Numbers k such that both 9*2^k - 1 and 9*2^k + 1 are prime.
Original entry on oeis.org
1, 3, 7, 43, 63, 211
Offset: 1
a(1) = 1 because 2*9 = 18 with 17 and 19 prime.
a(2) = 3 because 8*9 = 72 with 71 and 73 prime.
a(3) = 7 because 128*9 = 1152 with 1151 and 1153 prime.
a(4) = 43 because 8796093022208*9 = 79164837199872 with 79164837199871 and 79164837199873 prime.
-
q:= k-> (m-> andmap(isprime, [m-1, m+1]))(9*2^k):
select(q, [2*i-1$i=1..111])[]; # Alois P. Heinz, Aug 08 2025
-
from gmpy2 import is_prime
def is_TPpi2(e2, e3):
N = 2**e2 * 3**e3
return is_prime(N-1) and is_prime(N+1)
print([k for k in range(1, 100001, 2) if is_TPpi2(k, 2)])
Comments