Hello all,

First if this thread is misplaced I'm sorry I really don't know where to put it.

So here is my question, for some problems I have been able to "find" a way to solve them, but at some point I have something like:

f(n) = f(n-1) + k*f(n)

(with 0 < k < 1, and as n decrease, k decrease)

I imagine there's a mathematical way to find a result, but I don't know how. And well I would be more interested by a "computer" solution that I can code.

So if you have any idea of how to compute f(n) please share. And if there's no solution, please tell me

Thanks

## Recursion f(n) = f(n-1) + k*f(n)

### Re: Recursion f(n) = f(n-1) + k*f(n)

Just rewrite it as follows:Cerium wrote:f(n) = f(n-1) + k*f(n)

(with 0 < k < 1, and as n decrease, k decrease)

f(n) = f(n-1) + k*f(n)

f(n)-k*f(n) = f(n-1)

(1-k)f(n) = f(n-1)

f(n) = f(n-1)/(1-k)

and then it becomes easy to program. Even if k is not constant but some function of n, it still works.

_{Jaap's Puzzle Page}

### Re: Recursion f(n) = f(n-1) + k*f(n)

Oh yes obvious. I'm really feeling stupid right now. Thanks.