在 0x31 的 Prime Distance 这题末尾提到,该题时间复杂度为 $O(\sqrt R\log\log\sqrt R+(R-L)\log\log R)$,这可化简为 $O((R-L)\log\log R)$。 同一页的阶乘分解,这题末尾提到,该题对每个不超过 $n$ 的素数 $p$ 需要 $O(\log n)$ 的时间,那么复杂度应当为 $O(\pi(n)\log n)=O(n)$。