An amortized-complexity method to compute the Riemann zeta function