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.
%I A386730 #12 Aug 04 2025 01:11:43 %S A386730 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, %T A386730 20,10,64,63,27,88,99,2,16,10,169,135,51,141,52,231,320,44,419,143, %U A386730 476,207,332,97,324,738,1493,1320,333,1167,188,1440,2251,2033 %N A386730 a(n) is the 3-adic valuation of A027856(n). %C A386730 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. %H A386730 Ken Clements, <a href="/A386730/b386730.txt">Table of n, a(n) for n = 1..82</a> %e A386730 a(1) = 0 because A027856(1) = 4 = 2^2 * 3^0 %e A386730 a(2) = 1 because A027856(2) = 6 = 2^1 * 3^1 %e A386730 a(3) = 1 because A027856(3) = 12 = 2^2 * 3^1 %e A386730 a(4) = 2 because A027856(4) = 18 = 2^1 * 3^2 %e A386730 a(5) = 2 because A027856(5) = 72 = 2^3 * 3^2 %t A386730 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 *) %o A386730 (Python) %o A386730 from math import log10 %o A386730 from gmpy2 import is_prime %o A386730 l2, l3 = log10(2), log10(3) %o A386730 upto_digits = 200 %o A386730 sum_limit = 2 + int((upto_digits - l3)/l2) %o A386730 def TP_pi_2_upto_sum(limit): # Search all partitions up to the given exponent sum. %o A386730 unsorted_result = [(0, log10(4)), (1, log10(6))] %o A386730 for exponent_sum in range(3, limit+1, 2): %o A386730 for i in range(1, exponent_sum): %o A386730 j = exponent_sum - i %o A386730 log_N = i*l2 + j*l3 %o A386730 if log_N <= upto_digits: %o A386730 N = 2**i * 3**j %o A386730 if is_prime(N-1) and is_prime(N+1): %o A386730 unsorted_result.append((j, log_N)) %o A386730 sorted_result = sorted(unsorted_result, key=lambda x: x[1]) %o A386730 return sorted_result %o A386730 print([j for j, _ in TP_pi_2_upto_sum(sum_limit) ]) %Y A386730 Cf. A027856, A385433, A386731. %K A386730 nonn %O A386730 1,4 %A A386730 _Ken Clements_, Jul 31 2025