# Analysis of Algorithms for Moser's Problems on Sums of Consecutive Primes

**Authors:** Jonathan P. Sorenson, Eleanor Waiss

arXiv: 2509.00236 · 2025-09-03

## TL;DR

This paper analyzes two algorithms for computing the number of representations of integers as sums of consecutive primes, providing complexity bounds and generating data to address four longstanding open questions posed by Moser.

## Contribution

It offers a detailed complexity analysis of two existing algorithms and applies them to generate data that resolves four open problems in number theory.

## Key findings

- First algorithm runs in O(x log x) time with x^{2/3} space.
- Second algorithm has two versions: one with O(x log x) time and x^{3/5} space, another with O(x(log x)^2) time and O(√(x log x)) space.
- Data produced addresses all four open questions posed by Moser.

## Abstract

In his 1963 paper on the sum of consecutive primes, Moser posed four open questions related to $f(n)$, the number of ways an integer $n$ can be written as a sum of consecutive primes. (See also problem C2 from Richard K.~Guy's \textit{Unsolved Problems in Number Theory}.) In this paper, we present and analyze two algorithms that, when given a bound $x$, construct a histogram of values of $f(n)$ for all $n\le x$. These two algorithms were described, but not analyzed, by Jean Charles Meyrignac (2000) and Michael S. Branicky (2022). We show the first algorithm takes $O(x\log x)$ time using $x^{2/3}$ space, and the second has two versions, one of which takes $O(x\log x)$ time but only $x^{3/5}$ space, and the other which takes $O(x(\log x)^2)$ time but only $O( \sqrt{x\log x})$ space. However, Meyrinac's algorithm is easier to parallelize. We then present data generated by these algorithms that address all four open questions.

## Full text

_Full body text omitted from this summary view._ Fetch the complete paper as Markdown: https://tomesphere.com/paper/2509.00236/full.md

## Figures

3 figures with captions in the complete paper: https://tomesphere.com/paper/2509.00236/full.md

## References

13 references — full list in the complete paper: https://tomesphere.com/paper/2509.00236/full.md

---
Source: https://tomesphere.com/paper/2509.00236