Francesco Di Costanzo

Mertens Solver

Research into exact number-theory calculations on forty Arm cores, testing which computational shortcuts and learned choices earn their place.

  • Personal software
Visit project

Mertens Solver is a research project about making an enormous calculation practical without turning an exact answer into an estimate. My long-term goal is to compute the Mertens function at 10²⁶. The verified milestone so far is 10¹⁹, with a solver built on privately supplied work from a collaborator and developed through measured experiments on two NVIDIA DGX Sparks.

The question is easy to state. Give each positive integer a score using the Möbius function: start 1 at +1; score a number 0 if it contains a squared prime factor, such as 4 or 9; otherwise score it −1 for an odd number of distinct prime factors and +1 for an even number. So 2 scores −1 and 6, which is 2 × 3, scores +1. The Mertens function M(N) adds those scores through N. Through 10, they are +1, −1, −1, 0, −1, +1, −1, 0, 0, +1: a running balance of −1. The challenge is reaching vastly larger N without visiting every integer individually.

My work combines exact arithmetic, a distributed implementation and an experimental search for better ways to organise the calculation. The solver groups work into regions, balances where one method gives way to another, and uses compact representations with precomputed small-prime contributions. Two processes split the work across forty Arm CPU cores, twenty on each Spark. They contribute to one answer. Combining their results requires preserving signed contributions across region boundaries; simply adding two independent subtotals would lose terms.

Learning helps propose and rank computational choices, then complete timed calculations decide whether those choices help. It does not predict the Mertens value. In the seven-stage comparison, a learner carrying experience forward chose a faster validation program than ordinary search at equal charged cost on two stages. That is a useful result to examine, not evidence that learning wins everywhere. Compact data structures and a final cutoff comparison contributed separately. The released research checkpoint uses a fixed arithmetic recipe; it does not need a neural model to produce an answer.

At 10¹⁹, the frozen solver returned M(10¹⁹) = 899,990,187, agreeing with both reference solvers. Its median complete elapsed time was 108.437 seconds on forty Arm cores, compared with 132.262 and 160.449 seconds for the references in the same study. The clock included dispatch, computation, return and final combination. Repeated comparisons also covered two nearby inputs held back until the recipe was fixed. These are measurements of this hardware and experiment, not a speed guarantee for another machine or evidence that 10²⁶ is within reach yet.

The lesson for me is to keep a promising idea separate from what a whole calculation demonstrates. A clever local shortcut can lose its advantage once setup and coordination are counted; a faster final solver does not establish that its learner was responsible. Exact component checks, reference agreement and measured end-to-end costs make those distinctions visible. The linked research journal is password-protected. It is a record of the work, not an open solver demo or a public download of the collaborator's source.