A356271
Prime numbers in the sublists defined in A348168 that contain a single prime.
Original entry on oeis.org
2, 3, 5, 7, 23, 53, 89, 157, 173, 211, 293, 353, 359, 409, 449, 683, 691, 839, 919, 977, 983, 1039, 1069, 1103, 1109, 1201, 1223, 1237, 1283, 1327, 1381, 1439, 1459, 1511, 1613, 1627, 1637, 1709, 2039, 2099, 2179, 2213, 2221, 2243, 2251, 2273, 2447, 2633, 2917
Offset: 1
-
from sympy import nextprime; R = [2]; p0 = 2
while len(R) < 50:
p1 = nextprime(p0); p = nextprime(p1); g1 = p - p1
if g1 >= p1 - p0: R.append(p1)
else:
while p - p1 <= g1: p1 = p; p = nextprime(p)
p0 = p1
print(*R, sep = ', ')
A362017
a(n) is the leading prime in the n-th prime sublist defined in A348168.
Original entry on oeis.org
2, 3, 5, 7, 11, 17, 23, 29, 37, 53, 59, 67, 79, 89, 97, 127, 137, 149, 157, 163, 173, 179, 191, 197, 211, 223, 239, 251, 293, 307, 331, 347, 353, 359, 367, 397, 409, 419, 431, 439, 449, 457, 479, 521, 541, 557, 587, 631, 673, 683, 691, 701, 719, 787, 809, 821
Offset: 1
According to the definition in A348168, prime numbers are divided into sublists, L_1, L_2, L_3,..., in which L_n = [p(n,1), p(n,2), ..., p(n,m(n))], where p(n,k) is the k-th prime and m(n) the number of primes in the n-th sublist L_n. Thus, a(n) = p(n,1). The first sublist L_1 = [2]. If p(n,1) <= (prevprime(p(n,1)) + nextprime(p(n,1)))/2, then L_n has only 1 prime, p(n,1). Otherwise, m(n) is the largest integer such that g(n,1) >= g(n,i), where g(n,i) = p(n,i+1) - p(n,i) and 2 <= i <= m(n).
The first 32 primes, for example, are divided into 16 prime sublists:
[2],
[3],
[5],
[7],
[11,13],
[17,19],
[23],
[29,31],
[37,41,43,47],
[53],
[59,61],
[67,71,73],
[79,83],
[89],
[97,101,103,107,109,113],
[127,131].
The leading primes in these sublists are: 2, 3, 5, 7, 11, 17, 23, 29, 37, 53, 59, 67, 79, 89, 97, 127. Therefore, a(1) = 2, a(2) = 3, ..., and a(16) = 127.
-
from sympy import nextprime; R = [2]; L = [2]
for n in range(2, 57):
p0 = L[-1]; p1 = nextprime(p0); M = [p1]; g0 = p1-p0; p = nextprime(p1); g1 = p-p1
while g1 < g0 and p-p1 <= g1: M.append(p); p1 = p; p = nextprime(p)
L = M; R.append(L[0])
print(*R, sep =', ')
A356466
Prime numbers in the sublists defined in A348168 that contain exactly two primes.
Original entry on oeis.org
11, 13, 17, 19, 29, 31, 59, 61, 79, 83, 127, 131, 137, 139, 149, 151, 163, 167, 179, 181, 191, 193, 197, 199, 239, 241, 331, 337, 347, 349, 397, 401, 419, 421, 431, 433, 439, 443, 521, 523, 541, 547, 673, 677, 701, 709, 787, 797, 809, 811, 821, 823, 827, 829
Offset: 1
-
from sympy import nextprime; R = []; p0 = 2
while len(R) < 60:
p1 = nextprime(p0); M = [p1]; p = nextprime(p1); g1 = p - p1
while g1 < p1 - p0 and p - p1 <= g1: M.append(p); p1 = p; p = nextprime(p)
if len(M) == 2: R.extend(M)
p0 = p1
print(*R, sep = ', ')
A348178
The list of all prime numbers is split into sublists with the 1st sublist L_1 = {2} and n-th sublist L_n = {p_1, p_2, ..., p_m}. a(n) is the largest m such that the maximum prime gap in L_n is < p_1 - prevprime(p_1).
Original entry on oeis.org
1, 1, 1, 1, 2, 2, 1, 2, 4, 1, 2, 3, 2, 1, 6, 32, 4, 33, 55, 35, 28, 842, 124, 349, 131, 168, 394, 585, 575, 10972, 14683, 1762, 743, 9388, 62587, 551, 14434, 31184, 176163, 407736, 249427, 111406, 225524, 1530229, 4107702, 3581556, 116030, 10028870, 2065372
Offset: 1
-
from sympy import nextprime
L = [2]
for n in range(1, 50):
print(len(L), end = ', ')
p0 = L[-1]; p1 = nextprime(p0); g0 = p1 - p0; M = [p1]; p = nextprime(p1)
while p - p1 < g0: M.append(p); p1 = p; p = nextprime(p)
L = M
A381169
List of twin prime averages (A014574) is partitioned by including as many elements as possible in the n-th partition, L_n, such that any gap in L_n is smaller than the gap between L_n and L_(n-1) but not bigger than the first gap in L_n. a(n) is the number of elements in L_n.
Original entry on oeis.org
1, 1, 1, 1, 1, 1, 2, 2, 2, 3, 2, 2, 1, 1, 2, 1, 6, 3, 2, 2, 2, 1, 1, 5, 2, 2, 2, 3, 1, 2, 2, 2, 2, 3, 2, 2, 1, 2, 4, 2, 2, 2, 2, 5, 2, 2, 1, 1, 1, 3, 2, 2, 1, 3, 3, 2, 1, 4, 2, 3, 2, 2, 1, 2, 2, 3, 3, 1, 3, 2, 1, 2, 1, 1, 2, 3, 3, 1, 1, 2, 2, 3, 2, 2, 1, 5, 2
Offset: 1
Twin prime pair averages in the first 10 partitions are: [4], [6], [12], [18], [30], [42], [60, 72], [102, 108], [138, 150], and [180, 192, 198]. Thus, a(1) = a(2) = a(3) = a(4) = a(5) = a(6) = 1, a(7) = a(8) = a(9) = 2, and a(10) = 3.
-
from sympy import isprime, nextprime; L = [4]
def nexttwin(x):
p1 = nextprime(x); t1 = p1 + 2
while isprime(t1) == 0: p1 = nextprime(t1); t1 = p1 + 2
return p1+1
for _ in range(2, 89):
print(len(L), end = ', ')
t0 = L[-1]; t1 = nexttwin(t0); g0 = t1 - t0; M = [t1]; t = nexttwin(t1); g1 = t - t1
while g1 < g0 and t - t1 <= g1: M.append(t); t1 = t; t = nexttwin(t)
L = M
Showing 1-5 of 5 results.
Comments