I have here a function (written in python), which computes the sum of all numbers from $a$ to $b$. I'd like to know how to find mathematically it's time complexity (without using the master theorem). How can one do that?
Here's what I've tried so far:
I managed to express the left recursive side as: $\frac{\left(2^{k}-1\right)a+b}{2^{k}}$ (after writing the mid as a sum like so $\frac{a+\frac{a+\frac{a+b}{2}}{2}}{2}$ (the fraction may go further for large $k$-s).
comparing the resulting formula to $a$ as a base case for the function to stop does not yield results: $$\frac{\left(2^{k}-1\right)a+b}{2^{k}}=a\Rightarrow-a+b=0\Rightarrow a=b$$ which brings me back to the "starting point" and gives no new information about $k$. I'd really appreciate your help :)