How can the below recurrence be solved?
$T(n) = ( \sqrt{n} + 1)T( \sqrt{n}) + 1$ and $T(2) = 1$.
I have tried the master method, but have failed!!Any help regarding this is appreciated.
How can the below recurrence be solved?
$T(n) = ( \sqrt{n} + 1)T( \sqrt{n}) + 1$ and $T(2) = 1$.
I have tried the master method, but have failed!!Any help regarding this is appreciated.
Let $F(k) = T(2^{2^k})$, so that we have $$F(k+1) = (2^{2^k}+1)F(k) + 1$$ and $F(0) = 1$. The generating function for $F$ is \begin{align} S(x) = &\ \sum_{k\ge0}F(k)x^k\\ = &\ 1 + \sum_{k\ge0}((2^{2^k}+1)F(k)+1)x^{k+1}\\ = &\ 1 + xS(x) + \frac{1}{1-x} - 1 + \sum_{k\ge1}2^{2^k}F(k)x^{k+1}\\ = &\ xS(x) + \frac{1}{1-x} + \sum_{k\ge0}2^{2^k}F(k)x^{k+1}. \end{align} Now let $C_0 = 2$ and $C_i = 2^{2^{i-1}}(2^{2^{i-1}}-1)$, so that $$2^{2^k} = \sum_{i=0}^kC_i.$$ Using this and what done above, we write \begin{align} S(x) = &\ xS(x) + \frac{1}{1-x} + \sum_{k\ge0}2^{2^k}F(k)x^{k+1}\\ = &\ xS(x) + \frac{1}{1-x} + \sum_{i\ge0}C_i\sum_{k\ge i}F(k)x^{k+1}. \end{align} I don't know how to treat the last term, so I'll leave it up to you (or any volunteers).
You could also try to apply the master theorem to $G(\ell) = T(2^\ell)$, but from the question I assume you have already tried this.
The recurrence can be rewritten as:
$$\frac{T(n)}{n-1} = \frac{T(\sqrt{n})}{\sqrt{n} - 1} + \frac{1}{n-1}$$
or, with:
$$n = 2^{2^k} \quad\text{and}\quad C(k)= \frac{T(2^{2^k})}{2^{2^k} - 1}$$
as:
$$C(k) = C(k-1) + \frac{1}{2^{2^k}-1}$$
and after telescoping $C(k) - C(k-1)$:
$$C(k) = C(0) + \sum_{j=1}^{k} \frac{1}{2^{2^j}-1}$$
The latter series converges (by the ratio test, for example), so the limit exists:
$$\lim_{k \to \infty} C(k) = C$$
It follows that $T(2^{2^k}) \sim C \cdot (2^{2^k} - 1)$ asymptotically, so in the end $T(n) = \Theta(n)$.