Solve the following recurrence

39 Views Asked by At

Let $f(x) = 1+div(x)+ \max_{y|x}(f(y))$ where $y|x$ means y $\ne$x and divides x.
$f(1)=0$.
$div(x)=$ number of natural numbers $y$ , y$\ne$x and y is a divisor of $x$
Consider the following:
1. Is there a way to find $f(x)$ effectively?
2. Is there a way to find $\sum_{x=1}^{n}f(x)$ effectively?
My intution says that $f(x) = 1+div(x)+f(y)$ where $y$ is the largest divisor of $x$. Anyway finding the number of divisors can take $O(\sqrt{n})$ time and I believe there exists a better solution.