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.

This page as a plain text file.
%I A359440 #45 Jan 08 2023 13:30:18
%S A359440 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,
%T A359440 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,
%U A359440 0,0,0,1,0,0,1,0,0,1,0,0,1,1,0,0,1,0,0
%N 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.
%C A359440 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
%F A359440 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
%e A359440 For n = 1, prime(1) + prime(2) = 2 + 3 = 5; "prime(0)" does not exist, so a(1) = 0.
%e A359440 For n = 4:
%e A359440   j = 0:  prime(4) + prime(5) =  7 + 11 = 18;
%e A359440   j = 1:  prime(3) + prime(6) =  5 + 13 = 18;
%e A359440   j = 2:  prime(2) + prime(7) =  3 + 17 = 20 != 18, so a(4) = 1.
%e A359440 For n = 5:
%e A359440   j = 0:  prime(5) + prime(6) = 11 + 13 = 24;
%e A359440   j = 1:  prime(4) + prime(7) =  7 + 17 = 24;
%e A359440   j = 2:  prime(3) + prime(8) =  5 + 19 = 24;
%e A359440   j = 3:  prime(2) + prime(9) =  3 + 23 = 26 != 24, so a(5) = 2.
%o A359440 (Python)
%o A359440 import sympy
%o A359440 offset = 1
%o A359440 N = 100
%o A359440 l = []
%o A359440 for n in range(offset,N+1):
%o A359440     j = 0
%o A359440     first_sum = sympy.prime(n-j)+sympy.prime(n+j+1)
%o A359440     while (n-j) > 1:
%o A359440         j += 1
%o A359440         sum = sympy.prime(n-j)+sympy.prime(n+j+1)
%o A359440         if sum != first_sum:
%o A359440             break
%o A359440     l.append(max(0,j-1))
%o A359440 print(l)
%Y A359440 Cf. A000040, A006562, A051795, A055381, A081235.
%K A359440 nonn
%O A359440 1,5
%A A359440 _Alexandre Herrera_, Jan 01 2023
%E A359440 Introductory phrase added to name by _Peter Munn_, Jan 08 2023