sequence with and without recursion

Posted by Sergey on Stack Overflow See other posts from Stack Overflow or by Sergey
Published on 2010-03-11T17:03:40Z Indexed on 2010/03/11 17:39 UTC
Read the original article Hit count: 267

Filed under:
|

I have a sequence.

a1 = 1 - cos(x);
ai = a1 + (-1)^(i-1) * x^(2*i-2) / (2*i-2)!

I need to write this with and without recursion. But it has a different results.
Here is my code: http://codepaste.net/q213q6

© Stack Overflow or respective owner

Related posts about c

    Related posts about homework