An Efficient Algorithm for Estimating Prime Counts
We develop the Samojluk--Siemaszko (S--S) estimator for the prime-counting function $\pi(x)$ using a non-uniform partition generated by generalized triangular numbers. A cold-start evaluation uses $\big O(\sqrt{x})$ local terms, whereas consecutive partition nodes can be processed with amortized $\big O(1)$ update cost. Updated computations up to $10^{19}$, performed with the correction coefficient $c_T=0.7071$, show accuracy comparable with the Riemann approximation $R(x)$; the two estimators are also asymptotically equivalent at the level of their main term. The correction is written as a one-parameter family $S_{\ell,c}(x)$. Finite-range experiments indicate that effective coefficients lie near $0.7$. We prove asymptotic formulas for the natural scale $q_\ell(x)$ and the accumulated discretization error $D_\ell(x)$, obtaining an unconditional transfer relation between the normalized S--S error and the classical normalized prime-number-theorem error. Together with the logarithmic-mean theorem under RH, this identifies the exact coefficient $c_{\mathrm{th}}=1/\sqrt2$ as uniquely asymptotically optimal in the logarithmic-mean centering sense. The converse implication is quoted from a companion manuscript in preparation.