Finding the sum of a recursively defined function

59 Views Asked by At

Let f(n) be a function defined as such: $ f(1) = 1, f(2) = 1 + \frac{1}{2}, f(3) = 1 + \frac{1}{2} + \frac{1}{3} $ etc. Basically, $ f(x+1) = f(x) + \frac{1}{x+1} $

Does there exist a formula or any efficient method to calculate or approximate the sum $ S = \sum_{x = 1}^{n} f(x) $

where n is a positive integer greater than 1?

1

There are 1 best solutions below

6
On

Yes. If you define your sequence to be $a_{n+1} = a_n + \frac{1}{n+1}$, where $a_1 = 1$, we can define the partial sum, $H_n = \sum_{k=1}^{n} a_k$.

Let $$S_n = \sum_{i=1}^n H_n$$ $$S_n =\sum_{k=1}^n \frac{-k+n+1}{k}$$ $$S_n = (n+1)*H_n - n$$

And you can compute $H_n$ by computing the integral: $$H_n = \int_0^1 \frac{1-x^n}{1-x}dx$$