Little problem

Jorge Adriano
Wed, 27 Mar 2002 16:29:59 +0000

[moving to haskell-cafe]

>        Hello
>        I have little problem. I want to solve this equation
>           f(n-1) = f(n)+n
>           f(6)=6 

This is a simple recursive definition..
By the way, are you sure you didn't meant:

>           => f(2)=?

Not exactly sure what you're after here. You could simply do:

anyway it's simple to see, or even prove by induction, that
f(n) = (\sum_{i=n+1}^{7} i) -1 = (n+8)(7-n)/2 - 1

If I'm rigth and you're formula is suposed to be 
f(n-1) = f(n)+n
it is even easier.