$$T(n)=\sum_{i=0}^{k-1}\left\lfloor\frac n{2^i}\right\rfloor<n\sum_{i=0}^\infty\frac1{2^i}=2n$$ $$\implies T(n)=O(n)$$ For context: This calculates the number of flips for a binary counter. I understand the theory behind it. Each bit is flipped every $2^i$ times where $i$ is the index of the bit. This equation sums every bit flip for each index in the binary number.
I am confused by the math and how to derive $2n$.
Also, why is the less than symbol there along with the 2nd part of the equation?
For $x>0$, trivially $\lfloor x \rfloor \le x$. This means that
$$T(n)=\sum_{i=0}^{k-1}\left\lfloor\frac n{2^i}\right\rfloor\le \sum_{i=0}^{k-1}\frac{n}{2^i}=n\sum_{i=0}^{k-1}\frac1{2^i}.$$ Note that we're adding positive terms, so by adding more summands we get a bigger number, e.i. an upper bound. $$\sum_{i=0}^{k-1}\frac{n}{2^i}< n\sum_{i=0}^{\infty}\frac1{2^i}.$$ The last sum is a geometric series, which easily evaluates to $2$. Now we have showed $T(n)<2n$, which obviously implies that $S=O(n)$. (You may prove it with the quantifier definition of $O$.