In of my computer science classes, there is the following exam question:
Let an algorithm solve a problem of size $n$ by dividing it into the size $n \over 2$ in $n \over 2$ steps (division without remainder) and solve this problem recursively with the same strategy. A problem of size $1$ is solved in one step. Therefore, we have the function
$$f: \Bbb N \rightarrow \Bbb N$$
$$f(n) = {n \over 2 } + f\left({n \over 2}\right)$$
for $n > 1$ and $1$ for $n = 1$. One has to prove that $f(n) \in O(n)$.
I don't quite see how to perform the induction step here.
$$f(n+1) = {(n+1) \over 2} + f\left({n+1 \over 2}\right).$$
Now, the function has an input $n+1 \over 2$, which is a natural number by premise. But how to apply $f(n) \le n$ then?