Hi has anyone coded up integer factorization? I want, for example, R> factorize(60) $primes [1] 2 3 5 $powers [1] 2 1 1 (actually, I want the divisor function $\sigma_a(n)$, but coding this up requires integer factorization). -- Robin Hankin Uncertainty Analyst Southampton Oceanography Centre European Way, Southampton SO14 3ZH, UK tel 023-8059-7743
Hi Robin There is a function factorize() in the package conf.design library(conf.design) factorize(60) [1] 2 2 3 5 Hope this helps Christoph -- Christoph Buser <buser at stat.math.ethz.ch> Seminar fuer Statistik, LEO C11 ETH (Federal Inst. Technology) 8092 Zurich SWITZERLAND phone: x-41-1-632-5414 fax: 632-1228 stat.ethz.ch/~buser
See also primeFactors() and allFactors(): maths.lth.se/help/R/.R/library/R.basic/html/primeFactors.html maths.lth.se/help/R/.R/library/R.basic/html/allFactors.html in the R.basic package part of the R.classes bundle: maths.lth.se/help/R/R.classes Cheers Henrik Bengtsson> -----Original Message----- > From: r-help-bounces at stat.math.ethz.ch > [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Christoph Buser > Sent: Wednesday, January 05, 2005 11:14 AM > To: Robin Hankin > Cc: R-help at stat.math.ethz.ch > Subject: Re: [R] integer factorization > > > Hi Robin > > There is a function factorize() in the package conf.design > > library(conf.design) > factorize(60) > [1] 2 2 3 5 > > Hope this helps > Christoph > > -- > Christoph Buser <buser at stat.math.ethz.ch> > Seminar fuer Statistik, LEO C11 > ETH (Federal Inst. Technology) 8092 Zurich SWITZERLAND > phone: x-41-1-632-5414 fax: 632-1228 > stat.ethz.ch/~buser > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > R-project.org/posting-guide.html > >