I'm a high-school math student, and I recently stumbled upon an interesting, but counterintuitive result while solving a problem. I was trying to prove that the sum $S$ of all $x$ such that $x\in(0,1)$ was not finite. While doing so, I found this:
Using divide-and-conquer approach, $$\begin{aligned} S &= \left( \frac{1}{2} \right) + \left( \frac{1}{4} + \frac{3}{4} \right) + \left( \frac{1}{8} + \frac{3}{8} + \frac{5}{8} + \frac{7}{8} \right) + ...\infty \\ &= \sum_{i=1}^{\infty} \sum_{j=1}^{2^{i-1}} \frac{2j-1}{2^i} \\ &= \sum_{i=1}^{\infty} \frac{(2^{i-1})^2}{2^i} \\ &= \sum_{i=1}^{\infty} 2^{i-2} \\ &= \frac{1}{2} + 1 +2 + 4 + 8 +...\infty \end{aligned} $$ Is this valid or is there a flaw that I'm missing?