Table of Contents
Fetching ...

Artificial Intelligence in Number Theory: LLMs for Algorithm Generation and Ensemble Methods for Conjecture Verification

Ali Saraeb

TL;DR

The paper demonstrates two complementary AI-driven approaches in number theory: (i) a hint-based prompting study of the open-source LLM Qwen2.5-Math-7B-Instruct on 60 algorithmic/computational tasks from algorithmic number theory, achieving at least 0.95 accuracy with optimal hints, and (ii) an empirical verification of a folklore conjecture that the conductor $q$ of a Dirichlet character is determined by the initial zeros of $L(s,\chi)$, using engineered zero-features with Random Forest and LightGBM to achieve 0.939 test accuracy on $214$ cases and 0.967 validation accuracy. The work introduces the HANT benchmark for algorithmic tasks and a zero-feature framework for pattern discovery in Dirichlet zeros, suggesting a path toward constructing math-focused LLMs and deeper theoretical understanding of zeros. Together, these results illustrate how structured prompting and feature engineering can unlock reliable AI-assisted reasoning in specialized areas of number theory with potential for proof assistance and conjecture testing. The findings highlight both practical capabilities and methodological directions for integrating AI into advanced mathematical research.

Abstract

This paper presents two concrete applications of Artificial Intelligence to algorithmic and analytic number theory. Recent benchmarks of large language models have mainly focused on general mathematics problems and the currently infeasible objective of automated theorem proving. In the first part of this paper, we relax our ambition and focus on a more specialized domain: we evaluate the performance of the state-of-the-art open-source large language model Qwen2.5-Math-7B-Instruct on algorithmic and computational tasks in algorithmic number theory. On a benchmark of thirty algorithmic problems and thirty computational questions taken from classical number-theoretic textbooks and Math StackExchange, the model achieves at least 0.95 accuracy (relative to the true answer) on every problem or question when given an optimal non-spoiling hint. The second part of the paper empirically verifies a folklore conjecture in analytic number theory stating that the modulus \(q\) of a Dirichlet character \(χ\) is uniquely determined by the initial nontrivial zeros \(\{ρ_1,\dots,ρ_k\}\) (for some \(k\in\mathbb{N}\)) of the corresponding Dirichlet \(L\)-function \(L(s,χ)\). We train a LightGBM multiclass classifier to predict the conductor \(q\) for 214 randomly chosen Dirichlet \(L\)-functions from a vector of statistical features of their initial zeros (moments, finite-difference statistics, FFT magnitudes, etc.). The model empirically verifies the conjecture for small \(q\), achieving at least 93.9\% test accuracy when sufficient statistical properties of the zeros are incorporated. For the second part of the paper, code and dataset are available.

Artificial Intelligence in Number Theory: LLMs for Algorithm Generation and Ensemble Methods for Conjecture Verification

TL;DR

The paper demonstrates two complementary AI-driven approaches in number theory: (i) a hint-based prompting study of the open-source LLM Qwen2.5-Math-7B-Instruct on 60 algorithmic/computational tasks from algorithmic number theory, achieving at least 0.95 accuracy with optimal hints, and (ii) an empirical verification of a folklore conjecture that the conductor of a Dirichlet character is determined by the initial zeros of , using engineered zero-features with Random Forest and LightGBM to achieve 0.939 test accuracy on cases and 0.967 validation accuracy. The work introduces the HANT benchmark for algorithmic tasks and a zero-feature framework for pattern discovery in Dirichlet zeros, suggesting a path toward constructing math-focused LLMs and deeper theoretical understanding of zeros. Together, these results illustrate how structured prompting and feature engineering can unlock reliable AI-assisted reasoning in specialized areas of number theory with potential for proof assistance and conjecture testing. The findings highlight both practical capabilities and methodological directions for integrating AI into advanced mathematical research.

Abstract

This paper presents two concrete applications of Artificial Intelligence to algorithmic and analytic number theory. Recent benchmarks of large language models have mainly focused on general mathematics problems and the currently infeasible objective of automated theorem proving. In the first part of this paper, we relax our ambition and focus on a more specialized domain: we evaluate the performance of the state-of-the-art open-source large language model Qwen2.5-Math-7B-Instruct on algorithmic and computational tasks in algorithmic number theory. On a benchmark of thirty algorithmic problems and thirty computational questions taken from classical number-theoretic textbooks and Math StackExchange, the model achieves at least 0.95 accuracy (relative to the true answer) on every problem or question when given an optimal non-spoiling hint. The second part of the paper empirically verifies a folklore conjecture in analytic number theory stating that the modulus of a Dirichlet character is uniquely determined by the initial nontrivial zeros (for some ) of the corresponding Dirichlet -function \(L(s,χ)\). We train a LightGBM multiclass classifier to predict the conductor for 214 randomly chosen Dirichlet -functions from a vector of statistical features of their initial zeros (moments, finite-difference statistics, FFT magnitudes, etc.). The model empirically verifies the conjecture for small , achieving at least 93.9\% test accuracy when sufficient statistical properties of the zeros are incorporated. For the second part of the paper, code and dataset are available.
Paper Structure (22 sections, 117 equations, 13 figures, 6 tables)

This paper contains 22 sections, 117 equations, 13 figures, 6 tables.

Figures (13)

  • Figure : Heatmap 5.1.1: Mean metric scores by hint across all 30 algorithmic problems (see Appendix A.1).
  • Figure : Heatmap 5.1.2: Mean metric scores by hint across all 30 computational questions (see Appendix A.1).
  • Figure : Heatmap 5.2.1: True vs. predicted labels for the engineered‐feature classifier (100% accuracy). All points lie on the diagonal, indicating perfect classification.
  • Figure : Heatmap A.1.1: Mean Metric Scores by Hint: The heatmap presents the means of the metric scores averaged over all 30 algorithmic problems.
  • Figure : Heatmap A.1.2 Mean Metric Scores by Hint: The heatmap presents the means of the metric scores averaged over all 30 computational questions.
  • ...and 8 more figures