Re: Re[4]: [S] factors (divisors ) of an integer

Frank E Harrell Jr (fharrell@virginia.edu)
Fri, 11 Sep 1998 09:43:23 -0400


How about doing most of the job with

factorize <- function(n)
{
p <- n/(w <- c(1:trunc(sqrt(n)),n))
w[trunc(p) == p]
}

-------------------------------------------------------------------------------------------
Frank E Harrell Jr
Professor of Biostatistics and Statistics
Division of Biostatistics and Epidemiology
Department of Health Evaluation Sciences
University of Virginia School of Medicine
hesweb1.med.virginia.edu/biostatistics.html
-

-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu. To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message: unsubscribe s-news