cp's OEIS Frontend

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.

A386252 Numbers m of the form 2^i * 3^j * 5^k such that i, j, k > 0 and m+1 and m-1 are both prime numbers.

This page as a plain text file.
%I A386252 #17 Jul 23 2025 17:50:59
%S A386252 30,60,150,180,240,270,600,810,1620,3000,4050,4800,9000,9720,15360,
%T A386252 21600,23040,33750,138240,180000,281250,345600,737280,3456000,6144000,
%U A386252 6561000,10125000,13668750,15552000,17496000,20995200,22118400,24000000,30000000,54675000
%N A386252 Numbers m of the form 2^i * 3^j * 5^k such that i, j, k > 0 and m+1 and m-1 are both prime numbers.
%H A386252 Ken Clements, <a href="/A386252/b386252.txt">Table of n, a(n) for n = 1..926</a>
%e A386252 a(1) = 2^1 * 3^1 * 5^1 = 30 where 29 and 31 are prime numbers.
%e A386252 a(2) = 2^2 * 3^1 * 5^1 = 60 where 59 and 61 are prime numbers.
%e A386252 a(3) = 2^1 * 3^1 * 5^2 = 150 where 149 and 151 are prime numbers.
%e A386252 a(4) = 2^2 * 3^2 * 5^1 = 180 where 179 and 181 are prime numbers.
%t A386252 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 *)
%o A386252 (Python)
%o A386252 from math import log10
%o A386252 from gmpy2 import is_prime
%o A386252 l2, l3, l5 = log10(2), log10(3), log10(5)
%o A386252 upto_digits = 20
%o A386252 sum_limit = 3 + int((upto_digits - l3 - l5)/l2)
%o A386252 def TP_pi_3_upto_sum(limit): # Search all partitions up to the given exponent sum.
%o A386252     unsorted_result = []
%o A386252     for exponent_sum in range(3, limit+1):
%o A386252         for i in range(1, exponent_sum -1):
%o A386252              for j in range(1, exponent_sum - i):
%o A386252                 k = exponent_sum - i - j
%o A386252                 log_N = i*l2 + j*l3 + k*l5
%o A386252                 if log_N <= upto_digits:
%o A386252                     N = 2**i * 3**j * 5**k
%o A386252                     if is_prime(N-1) and is_prime(N+1):
%o A386252                         unsorted_result.append((N, log_N))
%o A386252     sorted_result = sorted(unsorted_result, key=lambda x: x[1])
%o A386252     return sorted_result
%o A386252 print([n for n, _ in TP_pi_3_upto_sum(sum_limit) ])
%Y A386252 Subsequence of A143207.
%Y A386252 Cf. A027856, A384530, A080185.
%K A386252 nonn
%O A386252 1,1
%A A386252 _Ken Clements_, Jul 16 2025