Goldbach's Function Approximation Using Deep Learning

Avigail Stekel, Merav Chkroun, Amos Azaria

Introduction

Goldbach’s Conjecture remains one of the most enduring mysteries in number theory. The "strong" version posits that every even integer greater than 2 can be expressed as the sum of two prime numbers. While verified computationally up to $4 \times 10^{18}$, a formal proof has not been found. Central to this problem is Goldbach’s function, $G(n)$, which counts the number of prime pairs summing to a given even integer $n$.

Goldbach's Comet: The distribution of G(n) for even integers up to 4,000,000.

When visualized, $G(n)$ forms a characteristic scattered distribution known as "Goldbach’s Comet." Traditional analytical approximations, such as those by Hardy and Littlewood, often rely on prime factorization—a process that becomes computationally intractable for very large numbers. Simpler monotone approximations fail to capture the inherent variance or "scatter" of the function. This research explores whether a data-driven deep learning approach can accurately predict $G(n)$ without the need for explicit factorization.

Methodology

The researchers employed a fully connected Multi-Layer Perceptron (MLP) with 5 hidden layers (200 neurons each). The core innovation of the study lies in the feature engineering strategy used to represent integers. Rather than using a single scalar input, the authors extracted 42 features for each integer $n$:

  1. Multi-base Representations: The 10 least significant digits of $n$ in bases 2, 3, 5, and 7.
  2. Magnitude Features: The normalized value of $n$ and its natural logarithm $\ln(n)$.

By providing digits in prime bases, the model is effectively given a "proxy" for the number's modular properties. Since primality is fundamentally linked to divisibility, these features allow the network to discern the underlying structure of $n$ efficiently. The model was trained on a dataset of $2 \times 10^6$ even integers ranging from 4 to $4 \times 10^6$.

Results and Discussion

The deep learning model achieved a significant improvement over existing analytical methods, reaching an error rate of 3.0%. In comparison, the state-of-the-art Baker approximation (2007) yielded a 4.4% error rate, while other common formulas (G3 and G4) lagged far behind with error rates exceeding 40%.

Comparison of the deep learning model against traditional analytical approximations (G1*, G2*, G3, G4).

A key finding was the disproportionate importance of the base-3 representation. Ablation studies indicated that removing base-3 features caused the most substantial increase in Mean Squared Error (MSE), suggesting a high correlation between ternary patterns and Goldbach partition counts.

Crucially, the model tracks the "scatter" of the comet qualitatively better than traditional formulas, which typically only capture the average trend. Because the model bypasses prime factorization, its prediction complexity is reduced to $O(\log n)$, offering a scalable path for approximating $G(n)$ for massive integers.

Conclusion

This study demonstrates that deep learning can identify complex patterns within rigid mathematical structures that previously required sophisticated analytical proofs. While the model's generalization to extreme scales (e.g., $n > 10^{100}$) remains an open question, it serves as a powerful proof of concept for the application of machine learning in theoretical number theory. Future work may involve expanding the feature set with additional prime bases to further refine accuracy.

Summary updated

BibTeX
@inproceedings{stekel2018goldbach,
  author = {Avigail Stekel and Merav Chkroun and Amos Azaria},
  title = {{Goldbach's Function Approximation Using Deep Learning}},
  booktitle = {WI},
  year = {2018},
  doi = {10.1109/wi.2018.00-46},
}

Loading related content...

Figure