Michael Somos on Sun, 31 Oct 1999 20:02:29 -0500 (EST)


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

fordiv() vs sumdiv()


                    GP/PARI CALCULATOR Version 2.0.17 (beta)
                i686 running linux (ix86 kernel) 32-bit version

parisize = 4000000, primelimit = 500000
gp> ??fordiv
fordiv(n,X,seq):

   the  formal  variable  X  ranging  through  the positive divisors of n,  the
sequence seq is evaluated. n must be of type integer.

gp> ??sumdiv
sumdiv(n,X,expr):

   sum of expression expr over the positive divisors of n.

gp> fordiv(-1,x,print(x))
1
gp> sumdiv(-1,x,print(x))
%1 = 0

In the case of fordiv() the divisor 1 is used, while in sumdiv() no divisor
is used. The documentation does not explain this difference. Shalom, Michael

-- 
Michael Somos <somos@grail.cba.csuohio.edu>     Cleveland State University
http://grail.cba.csuohio.edu/~somos/            Cleveland, Ohio, USA 44115