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.
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
Keywords
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.
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
Comments