He is recurrence relation and my solution:
$$ \begin{align} T(n) & = T(n/2) + O(n) \\[6pt] & = T(n/4) + \frac{cn}{2} + cn \\[6pt] & = T(n/8) + \frac{cn}{4}+ \frac{cn}{2} + cn \\ & {}\ \ \ \vdots \\ & = \sum_{i=0}^{logn}\frac{cn}{2^i} = cn \frac{1-(1/2)^{logn+1}}{1-1/2} \end{align} $$
I am not sure if I did geometric sequence in a right way. Could you please help me to verify if my math is correct here? Thanks
The upper limit of your summation is wrong -- it whould not be $n$. How many summands do you have? (recall that you start with $n$, then have $\frac{n}{2}$, $\frac{n}{4}$, $\frac{n}{8}$, $\ldots$, and stop when reaching, say $1$. This will only change the low-order terms of your solution (roughly, $1/n$ instead of $1/2^n$ in the fraction).
Also, importantly you may want to be careful with your $O(\cdot)$ notation. Did you mean a $\Theta(\cdot)$ (as your use of a constant $c$ seem to hint)? Recall that (for instance) $1=O(n)$, which would lead to a total complexity of $T(n)=\Theta(\log n)$.
Finally, as a general tool to solve or do sanity checks on the solutions of these recurrence relations, are you familiar with the Master theorem?