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.

A359440 A measure of the extent of reflective symmetry in the pattern of primes around each prime gap: a(n) is the largest k such that prime(n-j) + prime(n+1+j) has the same value for each j in 0..k.

Original entry on oeis.org

0, 0, 0, 1, 2, 2, 1, 0, 0, 4, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 2, 1, 0, 1, 0, 0, 0, 2, 0, 0, 0, 5, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0
Offset: 1

Views

Author

Alexandre Herrera, Jan 01 2023

Keywords

Comments

If the prime gaps above and below a prime p have the same length, p is called a balanced prime (see A006562). Likewise, if the prime gaps above and below the n-th prime gap have the same length, this gap might be called a balanced prime gap. These gaps correspond to nonzero terms a(n). Similarly, if a(n) >= 2, the n-th prime gap is the equivalent of a doubly balanced prime (A051795), and so on. - Peter Munn, Jan 08 2023

Examples

			For n = 1, prime(1) + prime(2) = 2 + 3 = 5; "prime(0)" does not exist, so a(1) = 0.
For n = 4:
  j = 0:  prime(4) + prime(5) =  7 + 11 = 18;
  j = 1:  prime(3) + prime(6) =  5 + 13 = 18;
  j = 2:  prime(2) + prime(7) =  3 + 17 = 20 != 18, so a(4) = 1.
For n = 5:
  j = 0:  prime(5) + prime(6) = 11 + 13 = 24;
  j = 1:  prime(4) + prime(7) =  7 + 17 = 24;
  j = 2:  prime(3) + prime(8) =  5 + 19 = 24;
  j = 3:  prime(2) + prime(9) =  3 + 23 = 26 != 24, so a(5) = 2.
		

Crossrefs

Programs

  • Python
    import sympy
    offset = 1
    N = 100
    l = []
    for n in range(offset,N+1):
        j = 0
        first_sum = sympy.prime(n-j)+sympy.prime(n+j+1)
        while (n-j) > 1:
            j += 1
            sum = sympy.prime(n-j)+sympy.prime(n+j+1)
            if sum != first_sum:
                break
        l.append(max(0,j-1))
    print(l)

Formula

a(n) = min( {n-1} U {k : 0 <= k <= n-2 and prime(n-k-1) + prime(n+k+2) <> prime(n) + prime(n+1)} ). - Peter Munn, Jan 08 2023

Extensions

Introductory phrase added to name by Peter Munn, Jan 08 2023