OFFSET
1,1
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..6085 (terms 1..926 from Ken Clements)
EXAMPLE
a(1) = 2^1 * 3^1 * 5^1 = 30 where 29 and 31 are prime numbers.
a(2) = 2^2 * 3^1 * 5^1 = 60 where 59 and 61 are prime numbers.
a(3) = 2^1 * 3^1 * 5^2 = 150 where 149 and 151 are prime numbers.
a(4) = 2^2 * 3^2 * 5^1 = 180 where 179 and 181 are prime numbers.
MATHEMATICA
seq[max_] := Select[Table[2^i*3^j*5^k, {i, 1, Log2[max]}, {j, 1, Log[3, max/2^i]}, {k, 1, Log[5, max/(2^i*3^j)]}] // Flatten // Sort, And @@ PrimeQ[# + {-1, 1}] &]; seq[10^8] (* Amiram Eldar, Jul 17 2025 *)
PROG
(Python)
from math import log10
from gmpy2 import is_prime
l2, l3, l5 = log10(2), log10(3), log10(5)
upto_digits = 20
sum_limit = 3 + int((upto_digits - l3 - l5)/l2)
def TP_pi_3_upto_sum(limit): # Search all partitions up to the given exponent sum.
unsorted_result = []
for exponent_sum in range(3, limit+1):
for i in range(1, exponent_sum -1):
for j in range(1, exponent_sum - i):
k = exponent_sum - i - j
log_N = i*l2 + j*l3 + k*l5
if log_N <= upto_digits:
N = 2**i * 3**j * 5**k
if is_prime(N-1) and is_prime(N+1):
unsorted_result.append((N, log_N))
sorted_result = sorted(unsorted_result, key=lambda x: x[1])
return sorted_result
print([n for n, _ in TP_pi_3_upto_sum(sum_limit) ])
(Python)
from itertools import islice
from heapq import heappop, heappush
from sympy import isprime
def A386252_gen(): # generator of terms
h, hset = [30], {30}
while True:
m = heappop(h)
if isprime(m-1) and isprime(m+1):
yield m
for p in (2, 3, 5):
mp = m*p
if mp not in hset:
heappush(h, mp)
hset.add(mp)
CROSSREFS
KEYWORD
nonn
AUTHOR
Ken Clements, Jul 16 2025
STATUS
approved
