Is there any research into or applications of machine learning in number theory?

I am also looking for (leading examples of) statistical/empirical analysis of number theory questions. Also wondering if genetic algorithms in particular have ever been used in these areas.

  • $\begingroup$ Let's assume the distribution of the primes is totally random (with known average density). What you're asking would be for SVM's, logistic regressions, and multilayer NN's to predict, better than random, something that has no pattern. Right? $\endgroup$ Commented Jun 19, 2015 at 14:51
  • $\begingroup$ We already know to exclude anything not ending in 1,3,7,9. And further results like in a number theory book say others not to check for primality. But what you're looking for is something like "Derive implications like this one?" Maybe it would have to learn on symbols? $\endgroup$ Commented Jun 19, 2015 at 14:57
  • 1
    $\begingroup$ Also possibly of interest: mathoverflow.net/q/390174/2312 on applications of deep learning to research mathematics $\endgroup$
    – J W
    Commented Apr 16, 2021 at 6:13
  • $\begingroup$ I saw some stuff in the early 00's, where they were trying to predict primality using digit values in the number via GA's. My computer was waaaaay to small to get in on it. $\endgroup$ Commented Apr 16, 2021 at 13:43

2 Answers 2


Genetic algorithms were used to lower the prime gap to 4680 in the recent Zhang twin primes proof breakthrough and associated Polymath project. The bound has been lowered by other methods but it shows some potential for machine learning approaches in this or related areas. they can be used to devise/optimize effective "combs" or basically sieves for analyzing/screening smallest-possible prime gaps.

Together and Alone, Closing the Prime Gap (Erica Klarreich, Quanta magazine, 19 November 2013):

The team eventually came up with the Polymath project’s record-holder — a 632-tooth comb whose width is 4,680 — using a genetic algorithm that “mates” admissible combs with each other to produce new, potentially better combs.


See the 2019 preprint Machine Learning meets Number Theory: The Data Science of Birch-Swinnerton-Dyer by Alessandretti, Baronchelli & He. Here is the Abstract:

Empirical analysis is often the first step towards the birth of a conjecture. This is the case of the Birch-Swinnerton-Dyer (BSD) Conjecture describing the rational points on an elliptic curve, one of the most celebrated unsolved problems in mathematics. Here we extend the original empirical approach, to the analysis of the Cremona database of quantities relevant to BSD, inspecting more than 2.5 million elliptic curves by means of the latest techniques in data science, machine-learning and topological data analysis.

Key quantities such as rank, Weierstrass coefficients, period, conductor, Tamagawa number, regulator and order of the Tate-Shafarevich group give rise to a high-dimensional point-cloud whose statistical properties we investigate. We reveal patterns and distributions in the rank versus Weierstrass coefficients, as well as the Beta distribution of the BSD ratio of the quantities. Via gradient boosted trees, machine learning is applied in finding inter-correlation amongst the various quantities. We anticipate that our approach will spark further research on the statistical properties of large datasets in Number Theory and more in general in pure Mathematics.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.