Message149492
| Author |
Ramchandra Apte |
| Recipients |
Ramchandra Apte |
| Date |
2011年12月15日.03:35:21 |
| SpamBayes Score |
3.731435e-06 |
| Marked as misclassified |
No |
| Message-id |
<1323920122.96.0.499037580838.issue13603@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
It would be nice to have prime-related and number theory functions in a new module or some existing module (like math).
like this:
>>> import prime
>>> prime.isprime(7)
True
>>> prime.isprime(35)
False
>>> prime.primerange(10,18)
(11,13,17)
>>> prime.isperfect(6) #Is 6 a perfect number (http://en.wikipedia.org/wiki/Perfect_number)
True
>>> prime.factorize(60)
{2:2,3:1,5:1} #2**2 * 3**1 * 5**1 |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2011年12月15日 03:35:23 | Ramchandra Apte | set | recipients:
+ Ramchandra Apte |
| 2011年12月15日 03:35:22 | Ramchandra Apte | set | messageid: <1323920122.96.0.499037580838.issue13603@psf.upfronthosting.co.za> |
| 2011年12月15日 03:35:22 | Ramchandra Apte | link | issue13603 messages |
| 2011年12月15日 03:35:21 | Ramchandra Apte | create |
|