A384835 The exponents (j, k) of the numbers 2^j*3^k that are averages of twin primes, with both j and k > 0, in the order of their sum, and then by j.
1, 1, 1, 2, 2, 1, 2, 3, 3, 2, 4, 3, 6, 1, 5, 4, 7, 2, 3, 10, 6, 7, 2, 15, 12, 5, 18, 1, 18, 5, 21, 4, 24, 5, 27, 4, 11, 24, 30, 7, 32, 9, 33, 8, 31, 12, 36, 7, 43, 2, 32, 15, 43, 8, 50, 9, 63, 2, 66, 25, 79, 20, 99, 10, 57, 64, 82, 63, 63, 88, 56, 99, 148, 27
Offset: 1
Examples
2^a(1) * 3^a(2) = 6. 2^a(3) * 3^a(4) = 18. 2^a(5) * 3^a(6) = 12. 2^a(7) * 3^a(8) = 108. 2^a(9) * 3^a(10) = 72.
Links
- Ken Clements, Table of n, a(n) for n = 1..162
Programs
-
Mathematica
seq[max_] := Flatten@ Transpose[IntegerExponent[Select[Flatten[Table[2^j*3^(m-j), {m, 2, max}, {j, 1, m-1}]], And @@ PrimeQ[# + {-1, 1}] &], #] & /@ {2, 3}]; seq[200] (* Amiram Eldar, Jun 26 2025 *)
-
Python
from sympy import isprime def is_TP_pi_2(j, k): N = 2**j * 3**k return isprime(N-1) and isprime(N+1) def aupto(limit): result = [1, 1] for exponent_sum in range(3, limit+1, 2): for j in range(1, exponent_sum): k = exponent_sum - j if is_TP_pi_2(j, k): result.append(j) result.append(k) return result print(aupto(10_000))
-
Python
import heapq from gmpy2 import is_prime from itertools import islice def agen(): # generator of terms v, oldv, h = 1, 0, [(2, 1, 1, 6)] while True: s, e2, e3, v = heapq.heappop(h) if v != oldv: if is_prime(v-1) and is_prime(v+1): yield from (e2, e3) oldv = v heapq.heappush(h, (s+1, e2+1, e3, 2*v)) heapq.heappush(h, (s+1, e2, e3+1, 3*v)) print(list(islice(agen(), 70))) # Michael S. Branicky, Jun 26 2025
Comments