Bill Allombert on Mon, 30 Sep 2002 15:42:46 +0200 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: apparent sigma() problem |
On Sun, Sep 29, 2002 at 11:52:55PM -0400, Igor Schein wrote: > Hi, > > ? sigma(2,-1) > 6 > > doesn't make sense. There's nothing in the manual that prevents 2nd > argument from being negative, so I'd expect the answer to be 3/2. Both you and the manual are correct, only the code is at fault: ? sigma(2,-1) %1 = 6 /*wrong*/ ? sigma(2,-2) %2 = 5/4 /*correct*/ Just an oversight, -1 was special cased, but we forgot to switch the signe so the correct formula sigma(n,-k)=sigma(n,k)*n^(-k) became the wrong one sigma(n,-1)=sigma(n,k)*n sigh... Thanks for spotting it! Cheers, Bill