View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
davidm davidm is offline
external usenet poster
 
Posts: 1
Default Need code to sum a series


I have been grappling with the algorithm to sum up the following series,
arguably a very awkward one.

1/(1*1) + 1/(1*2) + 1/(1*2*3)+1/(1*2*3*4) + ... + to the 150th term.

It would appear something between a recursive and For/Next construct
might be required but I can't quite get my head around it. Here was my
attempt (using a Function) which failed with Run time "out of stack
space" error.

Function SumSeries(n)
For i = n to 1 step -1
s = s + 1/(i*i-1*Sumseries(i))
Next
SumSeries = s
End Function

Sub test()
Msgbox Sumseries(150)
End Sub


--
davidm
------------------------------------------------------------------------
davidm's Profile: http://www.excelforum.com/member.php...o&userid=20645
View this thread: http://www.excelforum.com/showthread...hreadid=385467