Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I stumbled about this recursive function today:

$$f_n = f_\sqrt{n} + \sqrt n$$

I tried to solve it with substitution ($m = \log_2 n, \quad g_{2^m} = g_{2^{m/2}} + 2^{m/2}$), but I have a bad feeling with this result ($f_n \in \Theta(\sqrt n)$). Am I doing something wrong here? Could someone please explain me how to solve this recurrence function exactly?

share|cite|improve this question
up vote 1 down vote accepted

First, $f(x)\geqslant\sqrt{x}$ as soon as $f(x)\geqslant0$ for every $x\geqslant0$. On the other hand, if $f(x)\leqslant2\sqrt{x}+c$, then $f(x^2)\leqslant2\sqrt{x}+c+x\leqslant2x+c$ for every $x\geqslant4$.

This proves that, for $c$ large enough, $\sqrt{x}\leqslant f(x)\leqslant2\sqrt{x}+c$ for every $x\geqslant1$, and in particular that $f(x)=\Theta(\sqrt{x})$.

With a little more work, one can show that $f(x)/\sqrt{x}\to1$ when $x\to+\infty$ hence the asymptotics is given by the lower bound given above and the factor $2$ in the upper bound is a mere artefact.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.