<s>[INST] How to solve this series $f(n) = f(n/2) + n$? Can I solve this as:
$f(n) = f(n/2) + n$
let find, $$f(n/2) = f(n/2/2) + n/2\\
  f(n/2) = f(n/4) + n/2$$
Now,
$$\begin{split}
f(n) &= f(n/4) + n/2 + n\\
f(n) &= f(n/8) + n/4 + n/2 + n
\end{split}$$
hence so on.
$$\vdots$$
Now, $n = 2^i$.
$$\begin{split}
f(2^i) &= f(2^i/2^i) + 2^i/2^{i-1} + 2^i/2^{i-2} + \cdots + 2^i\\
f(2^i) &= f(1) + 2^1 + 2^2 + \cdots + 2^i\\
f(2^i) &= 2^0 + 2^1 + 2^2 + \cdots + 2^i\\
f(2^i) &= 2^{i+1} - 1\\
f(2^i) &= 2^i\cdot 2^1 - 1\\
f(n) &= 2n - 1\\
f(2^k) &= f(2^{k-k}) + k\\
f(2^k) &= f(2^0) + k\\
 \cdots &= f(1) + k\\
 \cdots &= 1 + k
\end{split}$$
As we know
$$\begin{split}
n &= 2^k\\
\log (n) &= k \log(2)\\
k &= \log (n) / \log(2)\\
k &= \log_2 (n)\\
f(n) &= \log_2(n) + 1
\end{split}$$
 [/INST] Given $$f(n) = f(n/2) + n$$ for all even integers $n\geq 2$, substitute the linear ansatz $f(n)= A n + B$ to yield
$$A n + B = A/2 n + B/2 + n.$$ Comparing coefficients of $n^1=n$ and of $n^0=1$ yields
the constraint equations $$A = A/2 + 1$$ and $$B=B/2$$ which are simultaneously solved only by $A=2$ and  $B=0$. So
$$f(n)=2n$$ is the only affine function satisfying the recurrence relation.
Similarly, the more general ansatz
$$f(n)= \sum_{k=0}^\infty A_k n^k$$ yields that all higher $A_k=0$ for $k\geq 2$.
Alternatively, one can assume there is a second solution $g(n)\neq f(n)$ for the appropriate $n$ and arrive at a contradiction. So
$$f(n)=2n$$ is the only solution.
</s>