Analysis of Algorithms for Moser's Problems on Sums of Consecutive Primes
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 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 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 x) time using x2/3 space, and the second has two versions, one of which takes O(x x) time but only x3/5 space, and the other which takes O(x( x)2) time but only O( x x) space. However, Meyrinac's algorithm is easier to parallelize. We then present data generated by these algorithms that address all four open questions.
Turn this paper into a full lesson
ArcXiv compiles a staged curriculum from this paper: 8-12 lessons across beginner → advanced, synthesised section guides, visuals, flashcards, a quiz, exercises, and on-demand deep dives per section. Grounded in the abstract, never invented.