English
Related papers

Related papers: Summing $\mu(n)$: a faster elementary algorithm

200 papers

We present an efficient and elementary algorithm for computing the number of primes up to $N$ in $\tilde{O}(\sqrt N)$ time, improving upon the existing combinatorial methods that require $\tilde{O}(N ^ {2/3})$ time. Our method has a similar…

Number Theory · Mathematics 2023-08-15 Dean Hirsch , Ido Kessler , Uri Mendlovic

Submodular functions are set functions mapping every subset of some ground set of size $n$ into the real numbers and satisfying the diminishing returns property. Submodular minimization is an important field in discrete optimization theory…

Data Structures and Algorithms · Computer Science 2020-01-16 Yassine Hamoudi , Patrick Rebentrost , Ansis Rosmanis , Miklos Santha

The Mertens function is defined as $M(x) = \sum_{n \leq x} \mu(n)$, where $\mu(n)$ is the M\"obius function. The Mertens conjecture states $|M(x)/\sqrt{x}| < 1$ for $x > 1$, which was proven false in 1985 by showing $\liminf M(x)/\sqrt{x} <…

Number Theory · Mathematics 2017-09-05 Greg Hurst

Storing a counter incremented $N$ times would naively consume $O(\log N)$ bits of memory. In 1978 Morris described the very first streaming algorithm: the "Morris Counter". His algorithm's space bound is a random variable, and it has been…

Data Structures and Algorithms · Computer Science 2022-04-01 Jelani Nelson , Huacheng Yu

We present a simple and fast algorithm for computing the $N$-th term of a given linearly recurrent sequence. Our new algorithm uses $O(\mathsf{M}(d) \log N)$ arithmetic operations, where $d$ is the order of the recurrence, and…

Symbolic Computation · Computer Science 2020-08-21 Alin Bostan , Ryuhei Mori

We describe an algorithm for arbitrary-precision computation of the elementary functions (exp, log, sin, atan, etc.) which, after a cheap precomputation, gives roughly a factor-two speedup over previous state-of-the-art algorithms at…

Numerical Analysis · Mathematics 2022-07-07 Fredrik Johansson

This paper presents a lower bound for optimizing a finite sum of $n$ functions, where each function is $L$-smooth and the sum is $\mu$-strongly convex. We show that no algorithm can reach an error $\epsilon$ in minimizing all functions from…

Machine Learning · Statistics 2015-10-06 Alekh Agarwal , Leon Bottou

We introduce a new class of objectives for optimal transport computations of datasets in high-dimensional Euclidean spaces. The new objectives are parametrized by $\rho \geq 1$, and provide a metric space $\mathcal{R}_{\rho}(\cdot, \cdot)$…

Data Structures and Algorithms · Computer Science 2023-07-20 Moses Charikar , Beidi Chen , Christopher Re , Erik Waingarten

A fast simple O(\log n) iteration algorithm for individual Lucas numbers is given. This is faster than using Fibonacci based methods because of the structure of Lucas numbers. Using a sqrt 5 conversion factor on Lucus numbers gives a faster…

Discrete Mathematics · Computer Science 2010-12-02 L. F. Johnson

We present a new O(k log n) algorithm of the Josephus problem. The time complexity of our algorithm is O(k log n), and this time complexity is on a par with the existing O(k log n) algorithm. We do not have any recursion overhead or stack…

Data Structures and Algorithms · Computer Science 2024-11-27 Hikaru Manabe , Ryohei Miyadera , Yuji Sasaki , Shoei Takahashi , Yuki Tokuni

A major goal in the area of exact exponential algorithms is to give an algorithm for the (worst-case) $n$-input Subset Sum problem that runs in time $2^{(1/2 - c)n}$ for some constant $c>0$. In this paper we give a Subset Sum algorithm with…

Data Structures and Algorithms · Computer Science 2023-01-31 Xi Chen , Yaonan Jin , Tim Randolph , Rocco A. Servedio

We present the first explicit comparison-based algorithm that sorts the sumset $X + Y = \{x_i + y_j,\ \forall 0 \le i, j < n\}$, where $X$ and $Y$ are sorted arrays of real numbers, in optimal $O(n^2)$ time and comparisons. While Fredman…

Data Structures and Algorithms · Computer Science 2025-04-24 S. Mundhra

We revisit the Subset Sum problem over the finite cyclic group $\mathbb{Z}_m$ for some given integer $m$. A series of recent works has provided near-optimal algorithms for this problem under the Strong Exponential Time Hypothesis. Koiliaris…

Data Structures and Algorithms · Computer Science 2020-11-02 Kyriakos Axiotis , Arturs Backurs , Karl Bringmann , Ce Jin , Vasileios Nakos , Christos Tzamos , Hongxun Wu

We revisit the fundamental Boolean Matrix Multiplication (BMM) problem. With the invention of algebraic fast matrix multiplication over 50 years ago, it also became known that BMM can be solved in truly subcubic $O(n^\omega)$ time, where…

Data Structures and Algorithms · Computer Science 2024-05-28 Amir Abboud , Nick Fischer , Zander Kelley , Shachar Lovett , Raghu Meka

Two recent lower bounds on the compressibility of repetitive sequences, $\delta \le \gamma$, have received much attention. It has been shown that a length-$n$ string $S$ over an alphabet of size $\sigma$ can be represented within the…

Data Structures and Algorithms · Computer Science 2023-11-10 Tomasz Kociumaka , Gonzalo Navarro , Francisco Olivares

Subset Sum is a classical optimization problem taught to undergraduates as an example of an NP-hard problem, which is amenable to dynamic programming, yielding polynomial running time if the input numbers are relatively small. Formally,…

Data Structures and Algorithms · Computer Science 2018-07-24 Konstantinos Koiliaris , Chao Xu

In this paper we propose a variant of the induced suffix sorting algorithm by Nong (TOIS, 2013) that computes simultaneously the Lyndon array and the suffix array of a text in $O(n)$ time using $\sigma + O(1)$ words of working space, where…

Data Structures and Algorithms · Computer Science 2020-09-10 Felipe A. Louza , Sabrina Mantaci , Giovanni Manzini , Marinella Sciortino , Guilherme P. Telles

We consider the following problem: given an unsorted array of $n$ elements, and a sequence of intervals in the array, compute the median in each of the subarrays defined by the intervals. We describe a simple algorithm which uses O(n) space…

Data Structures and Algorithms · Computer Science 2009-01-14 Beat Gfeller , Peter Sanders

We consider the problem of sorting $n$ items, given the outcomes of $m$ pre-existing comparisons. We present a simple and natural deterministic algorithm that runs in $O(m + \log T)$ time and does $O(\log T)$ comparisons, where $T$ is the…

Data Structures and Algorithms · Computer Science 2026-05-06 Bernhard Haeupler , Richard Hladík , John Iacono , Vaclav Rozhon , Robert Tarjan , Jakub Tětek

Let $\mu(n)$ denote the M\"obius function, define $M(x)= \sum_{n\leq x}^{}\mu (n)$. The main result of this paper is to prove that \begin{equation*} \displaystyle\lim_{x \to +\infty}\frac{M(x)}{x}=0 \end{equation*} which is equivalent to…

General Mathematics · Mathematics 2023-02-24 Junda Pan