1
$\begingroup$

Preface

I was playing around with matplotlib to generate some number sequences. I wound up looking at Goldbach pairs and manipulating them in different ways. End result was the following plots. I can't find anything specifically like it online. It reminds me of the prime number spiral video by 3Blue1Brown a few years ago, but not exactly.

I by no means think this is groundbreaking, but like I said, I cannot find any references or figures similar to the one I generated below. I suspect I just don't know what to search for.

Full view

Zoomed in

Graph explanation

X-Axis : Integers 1-1000

Y-Axis : Goldbach pair as a ratio where the numerator is the smallest number possible for the given integer. Examples just in case I'm not clear:

  • 4 = 2+2 : 2/2 = 1
  • 6 = 3+3 : 3/3 = 1
  • 8 = 3+5 : 3/5 = 0.6
  • 9 = 2+7 : 2/7 = 0.28571...

Data points at Y = 0 are numbers that don't have an associated prime pair sums. I could have filtered them out, but I did not.

Observation

The bottom curve (x = 4, 5, 7, 9...) looks to be the sequence prime+2, the next curve to be prime+3, then prime+4, etc.

Questions

Does this pattern have a name? Is there a simple explanation why this pattern emerges from this data set?

Amateur Python Code

import matplotlib.pyplot as plt

def is_prime(num):
    if num < 2:
        return False
    for i in range(2, int(num**0.5) + 1):
        if num % i == 0:
            return False
    return True

def generate_primes(start, end):
    primes = [num for num in range(start, end + 1) if is_prime(num)]
    return primes
            
pairs = []
new_pairs = []

q = 0

primes = generate_primes(0,1000)
print(primes)

for i in range(1000):
    for x in primes:
        for y in primes:
            if x + y == i:
                pairs.append([x,y])
                break
        if x + y == i:
            break
    if x + y != i:
        pairs.append([0,i])
        continue

for w in pairs:
    try:
        new_pairs.append([q+1,w[0]/w[1]])
    except Exception:
        continue
    q += 1

x_values, y_values = zip(*new_pairs)

#Plot data point labels
for i, (x, y) in enumerate(zip(x_values, y_values)):
    plt.text(x, y, f'{x:.0f}', ha='right', va='bottom')

plt.scatter(x_values, y_values, color='black', marker='o', label='Data Points', s=.5)

plt.xlabel('Integers')
plt.ylabel('Ratio of first Goldbach pair')

plt.legend()

plt.show()
$\endgroup$
3
  • $\begingroup$ We believe this is going to resemble a random phenomenon more than a pattern. For most large even integers $n$, one of the first several odd primes $p$ will have the property that $n-p$ is also prime; we can model that by a random variable. So I would expect the smallest prime for a given $n$ to look like an exponential random variable with parameter $\log n \log \log n$ (the size of the "$(\log n)$th" prime). This won't be exactly right due to local considerations, but close enough. $\endgroup$ Commented Dec 30, 2023 at 22:51
  • $\begingroup$ 2n is forced to either have 2n-3 prime, or be the sum of 2 primes congruent to n mod 3... you can do similar mod any prime... $\endgroup$ Commented Dec 30, 2023 at 23:04
  • $\begingroup$ Maybe look up the related goldbach's comet? $\endgroup$ Commented Dec 30, 2023 at 23:11

0

You must log in to answer this question.