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.

User: Ken Clements

Ken Clements's wiki page.

Ken Clements has authored 22 sequences. Here are the ten most recent ones:

A387201 Numbers k such that 32 * 3^k + 1 is prime.

Original entry on oeis.org

1, 4, 8, 9, 32, 36, 48, 74, 112, 186, 204, 364, 393, 572, 781, 1208, 2624, 2778, 4522, 4896, 5272, 32884
Offset: 1

Author

Ken Clements, Aug 21 2025

Keywords

Comments

a(23) > 10^5.
Conjecture: This sequence intersects with A387197 at k = 4 to form twin primes with center N = 2^5 * 3^4 = 2592 = A027856(10). Any such intersection has to be at an even k because if k is odd, either N-1 or N+1 has to be divisible by 5. A covering system can be constructed that eliminates all other intersections except where k = 4(mod 60), and for k > 4 with k = 4(mod 60), the search up to 10^5 makes the probability of another intersection in this residue class vanishingly small.

Programs

  • Mathematica
    Select[Range[0, 5000], PrimeQ[32 * 3^# + 1] &] (* Amiram Eldar, Aug 21 2025 *)
  • Python
    from gmpy2 import is_prime
    print([ k for k in range(4000) if is_prime(32 * 3**k + 1)])

A387197 Numbers k such that 32 * 3^k - 1 is prime.

Original entry on oeis.org

0, 3, 4, 6, 46, 59, 84, 94, 124, 239, 267, 366, 371, 424, 616, 2139, 2299, 3523, 3563, 3843, 3923, 7627, 12751, 34798, 39911, 56568, 58779
Offset: 1

Author

Ken Clements, Aug 21 2025

Keywords

Comments

a(28) > 10^5.
Conjecture: This sequence intersects with A387201 at k = 4 to form twin primes with center N = 2^5 * 3^4 = 2592 = A027856(10). Any such intersection has to be at an even k because if k is odd, either N-1 or N+1 has to be divisible by 5. A covering system can be constructed that eliminates all other intersections except where k = 4(mod 60), and for k > 4 with k = 4(mod 60), the search up to 10^5 makes the probability of another intersection in this residue class vanishingly small.

Programs

  • Mathematica
    Select[Range[0, 4000], PrimeQ[32 * 3^# - 1] &] (* Amiram Eldar, Aug 21 2025 *)
  • Python
    from gmpy2 import is_prime
    print([ k for k in range(4000) if is_prime(32 * 3**k - 1)])

A387060 Numbers k such that 16 * 3^k + 1 is prime.

Original entry on oeis.org

0, 3, 4, 5, 12, 24, 36, 77, 195, 296, 297, 533, 545, 644, 884, 932, 1409, 2061, 2453, 2985, 3381, 4980, 5393, 11733, 13631, 14516, 21004, 27663, 32645, 39453, 67055, 90543
Offset: 1

Author

Ken Clements, Aug 15 2025

Keywords

Comments

a(33) > 10^5.
Conjecture: The only intersection with A385115 is at k = 3 where 2^4 * 3^3 = 432 = A027856(8).
Idea: For odd k > 3, covering systems ensure mutual exclusion:
If k = 1, 9, 13, 19, 25, 31, 37, 39, 43, 49, 55 (mod 60), then 7 or 31 divides (16*3^k+1).
If k = 5, 7, 11, 17, 23, 27, 29, 35, 41, 47, 53, 57, 59 (mod 60), then 11 or 13 divides (16*3^k-1).
If k = 15, 21, 33, 45, 51 (mod 60), various primes including {11,31,43,109,277,433,...} ensure at least one of 16*3^k +- 1 is composite.
If k = 3 (mod 60) and k > 3, the probability of intersection becomes vanishingly small.
Only k = 3 escapes all divisibility conditions. Verified to k = 10^5.

Crossrefs

Programs

  • Mathematica
    Select[Range[0, 4000], PrimeQ[16*3^# + 1] &] (* Amiram Eldar, Aug 16 2025 *)
  • Python
    from gmpy2 import is_prime
    print([k for k in range(4_000) if is_prime(16 * 3**k + 1)])

A385115 Numbers k such that 2^4 * 3^k - 1 is prime.

Original entry on oeis.org

1, 3, 9, 13, 31, 43, 81, 121, 235, 1135, 1245, 1521, 2019, 2329, 3573, 11245, 15571, 37333, 54471, 70641
Offset: 1

Author

Ken Clements, Aug 14 2025

Keywords

Comments

All terms are odd, since if k were even, N = 2^4 * 3^k would be a perfect square and N - 1 could be factored as the difference of squares, hence not prime.
a(21) > 10^5. - Michael S. Branicky, Aug 15 2025

Crossrefs

Programs

  • Mathematica
    Select[Range[4000], PrimeQ[16 * 3^# - 1] &] (* Amiram Eldar, Aug 15 2025 *)
  • Python
    from gmpy2 import is_prime
    print([k for k in range(1, 4_000, 2) if is_prime(16 * 3**k - 1)])

Extensions

a(17)-a(20) from Michael S. Branicky, Aug 15 2025

A385956 Intersection of A025487 and A002378.

Original entry on oeis.org

2, 6, 12, 30, 72, 210, 240, 420, 1260, 6480, 50400, 147840, 510510, 4324320
Offset: 1

Author

Ken Clements, Aug 10 2025

Keywords

Comments

These numbers are the products of two consecutive integers that are also Hardy-Ramanujan integers; that is, of the form 2^k1*3^k2*...*p_n^k_n, where k1 >= k2 >= ... >= k_n. This sequence is finite with last term a(14) = 2079*2080 = 4324320.

Examples

			a(1) = 2 = 1*2 = 2^1.
a(2) = 6 = 2*3 = 2^1 * 3^1.
a(3) = 12 = 3*4 = 2^2 * 3^1.
a(4) = 30 = 5*6 = 2^1 * 3^1 * 5^1.
a(5) = 72 = 8*9 = 2^3 * 3^2.
a(6) = 210 = 14*15 = 2^1 * 3^1 * 5^1 * 7^1.
		

Crossrefs

Programs

  • Mathematica
    Select[FactorialPower[Range[0, 3000], 2], (Max@Differences[(f = FactorInteger[#])[[;; , 2]]] < 1 && f[[-1, 1]] == Prime[Length[f]]) &] (* Amiram Eldar, Aug 10 2025 *)
  • Python
    from sympy import prime, factorint
    def is_Hardy_Ramanujan(n):
        factors = factorint(n)
        p_idx = len(factors)
        if list(factors.keys())[-1] != prime(p_idx):
            return False
        expos = list(factors.values())
        e = expos[0]
        for i in range(1, p_idx):
            if expos[i] > e:
                return False
            e = expos[i]
        return True
    print([ n*(n+1) for n in range(1, 10_000) if is_Hardy_Ramanujan(n*(n+1))])

A386951 Intersection of A025487 and A007531.

Original entry on oeis.org

6, 24, 60, 120, 210, 720, 3360, 9240, 166320, 970200, 43243200
Offset: 1

Author

Ken Clements, Aug 10 2025

Keywords

Comments

These numbers are the products of three consecutive integers that are also Hardy-Ramanujan integers; that is, of the form 2^k1*3^k2*...*p_n^k_n, where k1 >= k2 >= ... >= k_n. This sequence is finite with last term a(11) = 350*351*352 = 43243200.

Examples

			a(1) = 6 = 1*2*3 = 2^1 * 3^1.
a(2) = 24 = 2*3*4 = 2^3 * 3^1.
a(3) = 60 = 3*4*5 = 2^2 * 3^1 * 5^1.
a(4) = 120 = 4*5*6 = 2^3 * 3^1 * 5^1.
a(5) = 210 = 5*6*7 = 2^1 * 3^1 * 5^1 * 7^1.
a(6) = 720 = 8*9*10 = 2^4 * 3^2 * 5^1.
		

Crossrefs

Programs

  • Mathematica
    Select[FactorialPower[Range[0, 1000], 3], (Max@ Differences[(f = FactorInteger[#])[[;; , 2]]] < 1 && f[[-1, 1]] == Prime[Length[f]]) &] (* Amiram Eldar, Aug 10 2025 *)
  • Python
    from sympy import prime, factorint
    def is_Hardy_Ramanujan(n):
        factors = factorint(n)
        p_idx = len(factors)
        if list(factors.keys())[-1] != prime(p_idx):
            return False
        expos = list(factors.values())
        e = expos[0]
        for i in range(1, p_idx):
            if expos[i] > e:
                return False
            e = expos[i]
        return True
    print([ n*(n+1)*(n+2) for n in range(1, 1000) if is_Hardy_Ramanujan(n*(n+1)*(n+2))])

A386857 Numbers k such that both 9*2^k - 1 and 9*2^k + 1 are prime.

Original entry on oeis.org

1, 3, 7, 43, 63, 211
Offset: 1

Author

Ken Clements, Aug 05 2025

Keywords

Comments

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.
Amiram Eldar noted that using A002236 and A002256, we obtain a(7) > 5.6*10^6, if it exists.

Examples

			a(1) = 1 because 2*9 = 18 with 17 and 19 prime.
a(2) = 3 because 8*9 = 72 with 71 and 73 prime.
a(3) = 7 because 128*9 = 1152 with 1151 and 1153 prime.
a(4) = 43 because 8796093022208*9 = 79164837199872 with 79164837199871 and 79164837199873 prime.
		

Crossrefs

Intersection of A002236 and A002256.

Programs

  • Maple
    q:= k-> (m-> andmap(isprime, [m-1, m+1]))(9*2^k):
    select(q, [2*i-1$i=1..111])[];  # Alois P. Heinz, Aug 08 2025
  • Python
    from gmpy2 import is_prime
    def is_TPpi2(e2, e3):
        N = 2**e2 * 3**e3
        return is_prime(N-1) and is_prime(N+1)
    print([k for k in range(1, 100001, 2) if is_TPpi2(k, 2)])

A386731 a(n) = A385433(n) + A386730(n).

Original entry on oeis.org

2, 2, 3, 3, 5, 5, 7, 7, 9, 9, 13, 13, 19, 17, 17, 23, 25, 29, 31, 37, 41, 45, 41, 43, 35, 43, 51, 47, 59, 65, 91, 99, 109, 121, 145, 175, 151, 155, 213, 291, 297, 259, 283, 349, 301, 415, 365, 369, 573, 683, 1103, 1017, 1195, 1347, 1537, 1619, 1717, 1751, 1957
Offset: 1

Author

Ken Clements, Jul 31 2025

Keywords

Comments

These numbers are sum of the exponents of 2 and 3 for the averages of twin primes in A027856. An interesting aspect is that after the first 2 terms, all of these are odd numbers. For all of those, the sum cannot be even because then for m = 2^i * 3^j, m-1 or m+1 would be divisible by 5.

Examples

			a(1) = A385433(1) + A386730(1) = 2
a(2) = A385433(2) + A386730(2) = 2
a(3) = A385433(3) + A386730(3) = 3
a(4) = A385433(4) + A386730(4) = 3
a(5) = A385433(5) + A386730(5) = 5
		

Crossrefs

Programs

  • Mathematica
    seq[max_] := Total[IntegerExponent[Select[Sort[Flatten[Table[2^i*3^j, {i, 1, Floor[Log2[max]]}, {j, 0, Floor[Log[3, max/2^i]]}]]], And @@ PrimeQ[# + {-1, 1}] &], #] & /@ {2, 3}]; seq[10^250] (* Amiram Eldar, Aug 01 2025 *)
  • Python
    from math import log10
    from gmpy2 import is_prime
    l2, l3 = log10(2), log10(3)
    upto_digits = 200
    sum_limit = 2 + int((upto_digits - l3)/l2)
    def TP_pi_2_upto_sum(limit): # Search all partitions up to the given exponent sum.
        unsorted_result = [(2, log10(4)), (1, log10(6))]
        for exponent_sum in range(3, limit+1, 2):
            for i in range(1, exponent_sum):
                j = exponent_sum - i
                log_N = i*l2 + j*l3
                if log_N <= upto_digits:
                    N = 2**i * 3**j
                    if is_prime(N-1) and is_prime(N+1):
                         unsorted_result.append((i+j, log_N))
        sorted_result = sorted(unsorted_result, key=lambda x: x[1])
        return sorted_result
    print([s for s, _ in TP_pi_2_upto_sum(sum_limit) ])

A385433 a(n) is the 2-adic valuation of A027856(n).

Original entry on oeis.org

2, 1, 2, 1, 3, 2, 6, 4, 7, 5, 6, 3, 18, 12, 2, 18, 21, 24, 27, 30, 33, 43, 32, 36, 11, 31, 43, 32, 50, 63, 66, 79, 99, 57, 82, 148, 63, 56, 211, 275, 287, 90, 148, 298, 160, 363, 134, 49, 529, 264, 960, 541, 988, 1015, 1440, 1295, 979, 258, 637, 2320, 1036, 2815, 1063, 180, 888
Offset: 1

Author

Ken Clements, Jul 31 2025

Keywords

Comments

These are the exponents, i, of the prime factor 2 of the A027856 numbers m = 2^i * 3^j where m is the average of twin primes. After the second term, all sums of i+j are odd because even sums (where j>0) make either m-1 or m+1 divisible by 5, which precludes twin primes except for the case of 6, where m-1 is divisible by 5, but 5 is the only number divisible by 5 that is also prime.

Examples

			a(1) = 2 because A027856(1) = 4 = 2^2 * 3^0
a(2) = 1 because A027856(2) = 6 = 2^1 * 3^1
a(3) = 2 because A027856(3) = 12 = 2^2 * 3^1
a(4) = 1 because A027856(4) = 18 = 2^1 * 3^2
a(5) = 3 because A027856(5) = 72 = 2^3 * 3^2
		

Crossrefs

Programs

  • Mathematica
    seq[max_] := IntegerExponent[Select[Sort[Flatten[Table[2^i*3^j, {i, 1, Floor[Log2[max]]}, {j, 0, Floor[Log[3, max/2^i]]}]]], And @@ PrimeQ[# + {-1, 1}] &], 2]; seq[10^250] (* Amiram Eldar, Aug 01 2025 *)
  • Python
    from math import log10
    from gmpy2 import is_prime
    l2, l3 = log10(2), log10(3)
    upto_digits = 200
    sum_limit = 2 + int((upto_digits - l3)/l2)
    def TP_pi_2_upto_sum(limit): # Search all partitions up to the given exponent sum.
        unsorted_result = [(2, log10(4)), (1, log10(6))]
        for exponent_sum in range(3, limit+1, 2):
            for i in range(1, exponent_sum):
                j = exponent_sum - i
                log_N = i*l2 + j*l3
                if log_N <= upto_digits:
                    N = 2**i * 3**j
                    if is_prime(N-1) and is_prime(N+1):
                         unsorted_result.append((i, log_N))
        sorted_result = sorted(unsorted_result, key=lambda x: x[1])
        return sorted_result
    print([i for i, _ in TP_pi_2_upto_sum(sum_limit) ])

A386730 a(n) is the 3-adic valuation of A027856(n).

Original entry on oeis.org

0, 1, 1, 2, 2, 3, 1, 3, 2, 4, 7, 10, 1, 5, 15, 5, 4, 5, 4, 7, 8, 2, 9, 7, 24, 12, 8, 15, 9, 2, 25, 20, 10, 64, 63, 27, 88, 99, 2, 16, 10, 169, 135, 51, 141, 52, 231, 320, 44, 419, 143, 476, 207, 332, 97, 324, 738, 1493, 1320, 333, 1167, 188, 1440, 2251, 2033
Offset: 1

Author

Ken Clements, Jul 31 2025

Keywords

Comments

These are the exponents, j, of the prime factor 3 of the A027856 numbers m = 2^i * 3^j where m is the average of twin primes. Except for the first term, all are greater than zero because all other A027856 numbers have both 2 and 3 as prime factors. After the second term, all sums of i+j are odd because even sums make either m-1 or m+1 divisible by 5, which precludes twin primes except for the case of 6, where m-1 is divisible by 5, but 5 is the only number divisible by 5 that is also prime.

Examples

			a(1) = 0 because A027856(1) = 4 = 2^2 * 3^0
a(2) = 1 because A027856(2) = 6 = 2^1 * 3^1
a(3) = 1 because A027856(3) = 12 = 2^2 * 3^1
a(4) = 2 because A027856(4) = 18 = 2^1 * 3^2
a(5) = 2 because A027856(5) = 72 = 2^3 * 3^2
		

Crossrefs

Programs

  • Mathematica
    seq[max_] := IntegerExponent[Select[Sort[Flatten[Table[2^i*3^j, {i, 1, Floor[Log2[max]]}, {j, 0, Floor[Log[3, max/2^i]]}]]], And @@ PrimeQ[# + {-1, 1}] &], 3]; seq[10^250] (* Amiram Eldar, Aug 01 2025 *)
  • Python
    from math import log10
    from gmpy2 import is_prime
    l2, l3 = log10(2), log10(3)
    upto_digits = 200
    sum_limit = 2 + int((upto_digits - l3)/l2)
    def TP_pi_2_upto_sum(limit): # Search all partitions up to the given exponent sum.
        unsorted_result = [(0, log10(4)), (1, log10(6))]
        for exponent_sum in range(3, limit+1, 2):
            for i in range(1, exponent_sum):
                j = exponent_sum - i
                log_N = i*l2 + j*l3
                if log_N <= upto_digits:
                    N = 2**i * 3**j
                    if is_prime(N-1) and is_prime(N+1):
                         unsorted_result.append((j, log_N))
        sorted_result = sorted(unsorted_result, key=lambda x: x[1])
        return sorted_result
    print([j for j, _ in TP_pi_2_upto_sum(sum_limit) ])