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.
%I A386857 #22 Aug 17 2025 14:08:04 %S A386857 1,3,7,43,63,211 %N A386857 Numbers k such that both 9*2^k - 1 and 9*2^k + 1 are prime. %C A386857 The exponent, k, of 2 must be odd because the exponent, 2, of 3 (where 9 = 3^2) is even and the sum of the exponents of prime factors 2 and 3 must be odd to form a product that is a twin prime average. Of all subsequences of A027856, this is the longest known where the power of 3 is fixed. %C A386857 Amiram Eldar noted that using A002236 and A002256, we obtain a(7) > 5.6*10^6, if it exists. %e A386857 a(1) = 1 because 2*9 = 18 with 17 and 19 prime. %e A386857 a(2) = 3 because 8*9 = 72 with 71 and 73 prime. %e A386857 a(3) = 7 because 128*9 = 1152 with 1151 and 1153 prime. %e A386857 a(4) = 43 because 8796093022208*9 = 79164837199872 with 79164837199871 and 79164837199873 prime. %p A386857 q:= k-> (m-> andmap(isprime, [m-1, m+1]))(9*2^k): %p A386857 select(q, [2*i-1$i=1..111])[]; # _Alois P. Heinz_, Aug 08 2025 %o A386857 (Python) %o A386857 from gmpy2 import is_prime %o A386857 def is_TPpi2(e2, e3): %o A386857 N = 2**e2 * 3**e3 %o A386857 return is_prime(N-1) and is_prime(N+1) %o A386857 print([k for k in range(1, 100001, 2) if is_TPpi2(k, 2)]) %Y A386857 Intersection of A002236 and A002256. %Y A386857 Cf. A014574, A384530, A027856, A385433, A181490. %K A386857 nonn,more %O A386857 1,2 %A A386857 _Ken Clements_, Aug 05 2025