[Tutor] while statement

Mic Forster micforster@yahoo.com
Thu May 1 02:38:02 2003


Hi,

What I want to do is quite simple but I have gotten
myself into a bind and any help is much appreciated.
In a nutshell I need to iterate through the follow
equation:

S(n) = [S(S-1)/N](1-n/N)**S-2

where S and N are fixed values but where n increases
by 1 after each iteration. So if S=31 and N=834 then
after the first iteration:

S(1) = [31(31-1)/834](1-1/834)**31-2
     = 1.077

Second iteration:

S(2) = [31(31-1)/834](1-2/834)**31-2
     = 1.04

and this is repeated until n = N.

I know that the while statement needs to be used but I
am unsure of the exact syntax. I am having problems
incrementing n by 1 in each iteration.

Thanks again for any help,
Mic

__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com