From tacarey at gmail.com  Thu Aug  7 11:26:08 2008
From: tacarey at gmail.com (tacarey at gmail.com)
Date: Thu,  7 Aug 2008 11:26:08 +0200 (CEST)
Subject: [Rd] bug in primes() function in the schoolmath package (PR#11957)
Message-ID: <20080807092608.C29C3282C760@mail.pubhealth.ku.dk>

I recently downloaded the R schoolmath package and found a bug in the
"primes" function.
I'm not sure if it has been reported or not.  I tried to report it to the
maintainer, but the email
address listed was no longer available.

Anyway ...

If you run the example from the document  *primes(12,150)* one of the
numbers returned is *133*.
This is not a prime number since 7 x 19 = 1*33*.
The is.prim() function works fine and if you use it to verify the primes()
function you
will find several entries that return false.

> is.prim(primes(start=2, end=500))
 [1]  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE
[13]  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE
[25]  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE *FALSE*  TRUE
TRUE
[37]  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE
[49]  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE *FALSE*  TRUE
TRUE
[61]  TRUE  TRUE  TRUE  TRUE  TRUE *FALSE*  TRUE  TRUE  TRUE  TRUE  TRUE
TRUE
[73]  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE
[85]  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE
[97]  TRUE  TRUE  TRUE


thanks

	[[alternative HTML version deleted]]



[Rd] bug in primes() function in the schoolmath package (PR#11957)
tacarey at gmail.com