The Goldbach Comet, Explained

After reading this you will know what the Goldbach function g(n) counts, why its scatter plot fans out into a comet with sharp bands, and how divisibility by 3 and 5 sorts the points into streaks you can predict by hand.

What the comet is

Pick an even number, say 28. Ask how many ways you can write it as a sum of two primes, order not mattering. You find 5 + 23, 11 + 17, and 17 + 11 which is the same pair, so it counts once. Working through all options gives three pairs: 5+23, 11+17, and no more. So g(28) = 3.

Do this for every even number and plot the point (n, g(n)). For small n the counts are one or two. As n grows the counts climb, but unevenly. The cloud of points spreads upward and to the right with a fuzzy head near the origin and a widening tail, so it looks like a comet. That shape is the whole subject here.

Goldbach's conjecture, stated in 1742, says g(n) \ge 1 for every even n \gt 2. No one has proved it. Every even number checked by computer (past 4 \times 10^{18}) has at least one pair, and the counts grow, but growth is not proof. The comet is a picture of an open problem.

When the comet is worth plotting

Plot the comet when you want to see structure in the primes that is hard to state in words. The banding is the payoff: it turns an abstract divisibility fact into three visible strands. The tool is also a clean way to feel how fast g(n) grows, which is roughly like n / (\ln n)^2.

Do not use the comet to test the conjecture. A finite plot cannot settle an infinite claim. If the point at some n sat on the axis it would disprove Goldbach, but no such point exists in reach, so the plot only ever confirms what is already known up to your limit. Treat it as a lens, not evidence.

The comet is a cousin of the Ulam prime spiral and the Sieve of Eratosthenes: all three make the primes visible so patterns jump out that formulas hide.

The Goldbach function and its formula

Define the count directly.

g(n) = \#\{(p,q) : p \le q,\ p + q = n,\ p,q\ \text{prime}\}

Here p and q are primes, the condition p \le q stops you from counting a pair twice, and \# means "number of." For n = 10 the pairs are 3+7 and 5+5, so g(10) = 2.

You can compute it fast. Sieve all primes up to n once, store a lookup table, then for each even n loop over primes p \le n/2 and count when n - p is also prime. The stopping point n/2 avoids the double count without any special case except the exact middle where p = q.

The average trend follows a heuristic. Hardy and Littlewood predicted that near a large n,

g(n) \approx 2\, C_2 \, \frac{n}{(\ln n)^2} \prod_{\substack{p \mid n \\ p \gt 2}} \frac{p-1}{p-2}

where C_2 \approx 0.6602 is the twin prime constant and the product runs over the odd primes that divide n. The plain fraction n/(\ln n)^2 sets the overall rise. The product is the important part for the bands: it is larger when n is divisible by small odd primes, which lifts those points into a higher strand.

A worked example reproducing the demo

Counting g(n) for n up to 30

The demo uses the field defaults, which compute g(n) from the first even number upward. Work the small end by hand so you can check the tool's first dozen points.

  1. List the primes up to 30: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29.
  2. For n = 4: only 2+2. So g(4) = 1.
  3. For n = 6: only 3+3. So g(6) = 1.
  4. For n = 12: try 5+7 (yes). 3+9 fails since 9 is not prime. So g(12) = 1.
  5. For n = 18: 5+13, 7+11. Two pairs, so g(18) = 2.
  6. For n = 30: 7+23, 11+19, 13+17. Three pairs, so g(30) = 3.

Notice 30 already beats 28 even though it is larger by only two. That is the banding at work: 30 = 2 · 3 · 5 is divisible by both 3 and 5, so the product factor lifts it, while 28 = 4 · 7 is not.

Goldbach counts for the first even numbers
nPrime pairsg(n)
42+21
63+31
103+7, 5+52
185+13, 7+112
245+19, 7+17, 11+133
285+23, 11+172
307+23, 11+19, 13+173
485+43, 7+41, 11+37, 17+31, 19+295

Note the small correction: recounting 28 carefully gives 5+23 and 11+17, so g(28) = 2, not 3. Always check that both summands are prime before you count the pair.

The points fan upward and split into strands. The top strand holds multiples of 6, like 90, 120, 180.

Why the comet splits into bands

The bands come from the product factor in the formula. Compare the odd primes dividing three kinds of n:

  • n divisible by 3 (and often by other small primes): the factor (p-1)/(p-2) for p=3 equals 2. That doubles the expected count. These points form the top band.
  • n not divisible by 3: no factor of 2 from p = 3, so the count sits lower. These form the bottom band.

Multiples of 3 that are also multiples of 5 get an extra factor (5-1)/(5-2) = 4/3 \approx 1.333, lifting them into an even higher sub-band. Try it: g(30) = 3 versus g(28) = 2 at nearly the same n. The ratio 3/2 = 1.5 is in the right neighborhood of the combined lift from 3 and 5. The comet is not one cloud but several parallel clouds, sorted by the small-prime signature of n.

Points with n divisible by 3 sit in a higher band than points not divisible by 3, because the Hardy-Littlewood product multiplies their expected count by 2. Coloring the scatter by n mod 6 separates the comet into two clear strands, with multiples of 30 forming a third strand higher still.

Reading and interpreting the plot

Three features carry meaning. First, the lower edge of the comet: no point ever reaches the axis, which is Goldbach's conjecture holding up to your limit. Second, the overall slope: the head is thin because small even numbers have few pairs, and the tail thickens because g(n) grows without bound on average. Third, the vertical spread within a fixed slice of n: at n near 200 the counts range from about 6 to 14, and that spread is the band structure, not noise.

To read the trend line, compare g(n) against n/(\ln n)^2. At n = 200, \ln 200 \approx 5.298, so (\ln 200)^2 \approx 28.07 and 200/28.07 \approx 7.12. Multiply by 2 C_2 \approx 1.320 to get about 9.4 as the rough expected count for a number with no special divisibility. Observed values scatter around that once you separate the bands.

Common mistakes

The most frequent error is double counting. The pair 11 + 17 and 17 + 11 are the same split. If you loop p from 2 all the way to n instead of stopping at n/2, you count every mixed pair twice and get roughly 2 g(n).

A second mistake is forgetting to check both summands. When you write n - p, that number must be prime too. For n = 12 and p = 3, n - p = 9, which is not prime, so that is not a valid pair. Skip it.

A third mistake is reading the plot as proof. The comet confirms Goldbach only for the range you drew. Raising the limit from 200 to 20000 changes the picture but not the logical status: the conjecture stays unproven. A fourth trap is treating the bands as separate curves with their own laws. They share one formula; the bands are the product factor taking a few fixed values.

Related tools

If the primes themselves interest you more than their sums, the Sieve of Eratosthenes shows how they are found, and the Ulam prime spiral shows diagonal streaks in the same primes arranged differently. For other pictures that turn number theory into geometry, try the Modular times table and its cardioids, Pascal's triangle mod n with its Sierpinski patterns, and Ford circles and Farey fractions. If you enjoy watching a rule generate order over many steps, the Collatz orbits tool follows a different unsolved problem.

Frequently asked questions

Does the comet prove Goldbach's conjecture?

No. It shows g(n) \ge 1 for every even n up to your limit, which is a check, not a proof. The conjecture is a claim about all even numbers, infinitely many, and no finite plot can settle that.

Why does the comet have three or more separate bands?

Because the expected count is multiplied by (p-1)/(p-2) for each odd prime p dividing n. Divisibility by 3 multiplies by 2, divisibility by 5 by 4/3, and so on. Numbers sharing the same small-prime divisors land in the same band.

Why does the tail get thicker instead of the whole comet just rising?

The average count grows like n/(\ln n)^2, so all bands rise. The bands are separated by fixed multiplicative factors, so as the counts grow larger the gap in absolute terms widens too, making the tail look thicker.

How high can I set the limit before it slows down?

The sieve is cheap, but counting pairs for every even number is roughly proportional to the total number of primes below your limit summed across all n. In a browser a limit of a few hundred thousand is comfortable; millions will take noticeable time and memory since every point is drawn.

Is g(n) ever zero for large n?

Never in any search done so far, past 4 \times 10^{18}. The heuristic count grows without bound, so a zero would be a genuine shock. But "never seen" is not "cannot happen," which is exactly why the problem stays open.