A new approach to analyzing intrinsic properties of the Josephus function, $J_{_k}$, is presented in this paper. The linear structure between extreme points of $J_{_k}$ is fully revealed, leading to the design of an efficient algorithm for evaluating $J_{_k}(n)$. Algebraic expressions that describe how recursively compute extreme points, including fixed points, are derived. The existence of consecutive extreme and also fixed points for all $k\geq 2$ is proven as a consequence, which generalizes Knuth result for $k=2$. Moreover, an extensive comparative numerical experiment is conducted to illustrate the performance of the proposed algorithm for evaluating the Josephus function compared to established algorithms. The results show that the proposed scheme is highly effective in computing $J_{_k}(n)$ for large inputs.
翻译:本文提出了一种分析约瑟夫斯函数 $J_{_k}$ 内在性质的新方法。我们完整揭示了 $J_{_k}$ 极值点之间的线性结构,进而设计了一种高效求值 $J_{_k}(n)$ 的算法。推导出了递归计算极值点(包括不动点)的代数表达式。由此证明了对于所有 $k\geq 2$ 均存在连续的极值点及不动点,这一结果推广了 Knuth 关于 $k=2$ 的结论。此外,我们开展了广泛的数值对比实验,用于展示所提算法与现有算法在求值约瑟夫斯函数时的性能差异。结果表明,所提方案在计算大输入规模的 $J_{_k}(n)$ 时具有极高的效率。