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.

Showing 1-5 of 5 results.

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

Views

Author

Ya-Ping Lu, Aug 01 2022

Keywords

Comments

It seems that lim_{n->oo} n/primepi(a(n)) = 0.102 approximately.

Crossrefs

Cf. A348168.

Programs

  • Python
    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

Views

Author

Ya-Ping Lu, Apr 04 2023

Keywords

Comments

If Conjecture 2 in A348168 is true, lim_{n->infinity} a(n)/prime(round((n-1)*e)+1) = 1, where e is Euler's number.
If a term p (>2) is from a single-prime sublist (A356271), then p is a weak prime (A051635) or a balanced prime (A006562). Otherwise, p is a strong prime (A051634).
The definition divides the primes into maximal sublists such that gaps between adjacent primes in a sublist are smaller than the gap that precedes the sublist and no larger than the first gap within the sublist. - Peter Munn, Jul 07 2025

Examples

			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.
		

Crossrefs

Programs

  • Python
    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

Views

Author

Ya-Ping Lu, Aug 08 2022

Keywords

Comments

Let g = q - p be the gap between a pair of primes in the sequence, g < p - previprime(p) and g < nextprime(q) - q.
It seems that lim_{n-> oo} n/primepi(a(n)) = 0.314 approximately.

Crossrefs

Cf. A348168.

Programs

  • Python
    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

Views

Author

Ya-Ping Lu, Oct 05 2021

Keywords

Comments

The last prime in the n-th sublist is A134266(n). The gap between the n-th and (n+1)-th sublists is A085237(n).

Crossrefs

Programs

  • Python
    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

Views

Author

Ya-Ping Lu, Feb 15 2025

Keywords

Comments

The partition method used here is the same as that in A348168.
Conjecture 1: lim_{n->oo} N_i/n = k_i, where N_i is the number of partitions with i elements and k_i is a constant, with k_2 > k_1 > k_3 > k_4 > .... The values of k_i are the same as those in A348168.
Conjecture 2: lim_{n->oo} Sum_{1..n} a(n)/n = lim_{i->oo} Sum_{1..i} i*k_i = e, or the average partition length approaches 2.71828... as n tends to infinity.
Numbers of twin prime pairs (N) and partitions with 1 through 6 twin prime pairs for n up to 10000000 are given in the table below.
n N N_1 N_2 N_3 N_4 N_5 N_6
-------- -------- ------- ------- ------- ------ ------ ------
1 1 1 0 0 0 0 0
10 15 6 3 1 0 0 0
100 209 30 45 16 5 3 1
1000 2536 286 416 145 64 29 19
10000 26474 2851 4331 1271 544 311 190
100000 271338 28034 43375 12923 5731 3002 1870
1000000 2725126 281837 434234 128190 56563 30074 18171
10000000 27120107 2815831 4352926 1276953 563128 302256 181612

Examples

			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.
		

Crossrefs

Programs

  • Python
    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.