math
audury0624
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Project Euler 23:Find the sum of all the positive integers which cannot be writt
A perfect number is a number for which the sum of its proper divisors is exactly equal to the number. For example, the sum of the proper divisors of 28 would be 1 + 2 + 4 + 7 + 14 = 28, which means th...原创 2013-05-16 12:08:13 · 245 阅读 · 0 评论 -
判断一个数是质数的几种方法
质数也叫素数,是只能被1和它本身整除的正整数,最小的质数是2,目前发现的最大的质数是p=2^57885161-1【注1】。判断一个数是质数的最简单的方法如下:[code="Python"]def isPrime1(n): for i in range(2, n): if n % i == 0: return False return True[/code]...原创 2013-05-17 16:28:42 · 718 阅读 · 0 评论
分享