The integer complexity $f(n)$ of a positive integer $n$ is defined as the minimum number of 1's needed to represent $n$, using additions, multiplications and parentheses. We present two simple and faster algorithms for computing the integer complexity: 1) A near-optimal $O(N\mathop{\mathrm{polylog}} N)$-time algorithm for computing the integer complexity of all $n\leq N$, improving the previous $O(N^{1.223})$ one [Cordwell et al., 2017]. 2) The first sublinear-time algorithm for computing the integer complexity of a single $n$, with running time $O(n^{0.6154})$. The previous algorithms for computing a single $f(n)$ require computing all $f(1),\dots,f(n)$.
翻译:正整数$n$的整数复杂度$f(n)$定义为通过加法、乘法和括号表示$n$所需的最少1的个数。我们提出两种更简单且更快速的整数复杂度计算算法:1) 一种近最优的$O(N\mathop{\mathrm{polylog}} N)$时间算法,用于计算所有$n\leq N$的整数复杂度,改进了此前$O(N^{1.223})$的算法 [Cordwell等人,2017]。2) 首个用于计算单个$n$整数复杂度的亚线性时间算法,运行时间为$O(n^{0.6154})$。此前计算单个$f(n)$的算法需要计算所有$f(1),\dots,f(n)$。