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.

Original entry on oeis.org

30, 60, 150, 180, 240, 270, 600, 810, 1620, 3000, 4050, 4800, 9000, 9720, 15360, 21600, 23040, 33750, 138240, 180000, 281250, 345600, 737280, 3456000, 6144000, 6561000, 10125000, 13668750, 15552000, 17496000, 20995200, 22118400, 24000000, 30000000, 54675000
Offset: 1

Views

Author

Ken Clements, Jul 16 2025

Keywords

Examples

			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.
		

Crossrefs

Subsequence of A143207.

Programs

  • 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 *)
  • 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) ])