An incremental approximation to the prime-counting function via polygonal numbers
We construct an incremental prime-counting approximation from corrected right-endpoint sums on polygonal-number partitions. For each fixed polygonal family, retaining completed contributions gives $\mathcal O(1)$ numerical operations per consecutive node and $\mathcal O(\sqrt X)$ operations for the full traversal through $X$, in the unit-cost model. The scheme uses a fixed number of working numerical words rather than repeated summation. Asymptotic formulas for the discretization error and terminal scale yield an unconditional relation with the classical normalized prime-counting error. We prove that the logarithmic mean of the normalized estimator error converges to $1/\sqrt2$ if and only if the Riemann hypothesis holds, and give an independent Mellin proof of the converse. Under the hypothesis, this constant uniquely removes the limiting signed mean bias. Computations at powers of ten through $10^{19}$ with coefficient $0.7071$ show accuracy comparable to the Riemann approximation at the sampled arguments