Last added floating point term of harmonic series In a system using IEEE 754 single precision floating point numbers, if we start calculating the sum $\sum_{i=0}^n 1/i$ , because of the precision the sum will not go to infinity but after a term N, any term added won't change the sum, which in our case must be ~15.4 . What's the way of finding this term N?

We have $\sum_{i=0}^n 1/i\approx \log n + 0.577$, which is easily close enough for what we want.  The mantissa is $24$ bits, so you need $\frac 1N \lt 2^{-24+E}$, where $E$ is the exponent for the current value of the sum.   $E(n)=\lfloor \log_2 \log (n + 0.577)\rfloor$  This gives $\frac 1n \lt 2^{-24}(\log n+0.577)$  I let Alpha do the numerics, getting $n=1154191$  If you need the exact answer, you should worry about the rounding on $\frac 1N$ when it is added into the sum.  The LSB of the sum will be $2^{-20}$, so if we just need $\frac 1N$ less than this, we need $N=2^{20}+1$
