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.

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

This page as a plain text file.
%I A386731 #12 Aug 06 2025 00:53:04
%S A386731 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,
%T A386731 51,47,59,65,91,99,109,121,145,175,151,155,213,291,297,259,283,349,
%U A386731 301,415,365,369,573,683,1103,1017,1195,1347,1537,1619,1717,1751,1957
%N A386731 a(n) = A385433(n) + A386730(n).
%C A386731 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.
%H A386731 Ken Clements, <a href="/A386731/b386731.txt">Table of n, a(n) for n = 1..82</a>
%e A386731 a(1) = A385433(1) + A386730(1) = 2
%e A386731 a(2) = A385433(2) + A386730(2) = 2
%e A386731 a(3) = A385433(3) + A386730(3) = 3
%e A386731 a(4) = A385433(4) + A386730(4) = 3
%e A386731 a(5) = A385433(5) + A386730(5) = 5
%t A386731 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 *)
%o A386731 (Python)
%o A386731 from math import log10
%o A386731 from gmpy2 import is_prime
%o A386731 l2, l3 = log10(2), log10(3)
%o A386731 upto_digits = 200
%o A386731 sum_limit = 2 + int((upto_digits - l3)/l2)
%o A386731 def TP_pi_2_upto_sum(limit): # Search all partitions up to the given exponent sum.
%o A386731     unsorted_result = [(2, log10(4)), (1, log10(6))]
%o A386731     for exponent_sum in range(3, limit+1, 2):
%o A386731         for i in range(1, exponent_sum):
%o A386731             j = exponent_sum - i
%o A386731             log_N = i*l2 + j*l3
%o A386731             if log_N <= upto_digits:
%o A386731                 N = 2**i * 3**j
%o A386731                 if is_prime(N-1) and is_prime(N+1):
%o A386731                      unsorted_result.append((i+j, log_N))
%o A386731     sorted_result = sorted(unsorted_result, key=lambda x: x[1])
%o A386731     return sorted_result
%o A386731 print([s for s, _ in TP_pi_2_upto_sum(sum_limit) ])
%Y A386731 Cf. A385433, A386730, A027856.
%K A386731 nonn
%O A386731 1,1
%A A386731 _Ken Clements_, Jul 31 2025