in reply to issues using bigrat
First you said:
"I expected to get 5/2 for n = 2 and 13/3 for n = 3, etc."
But then you said that:
was correct. Did you want "n=2 to equal 1" or "n=2 to equal 5/2"? (though I can't see how this would mangle the output like it does. I haven't quite figured that part out...*grumble*...:-).n = 2, sum = 1 n = 3, sum = 5/2
But I sorta mentally ran the 1st loop for n=1. That starts with the inner loop being
which isn't horrible by itself, but certainly isn't what I'd expect for a 1st iteration of your series:"for my $k (1 .. 0) {"
"Sumof(Num/Denom) for Num=(1..n) and Denom='(n..1)'[=>'n+1-Num']"
|
|---|