2012年6月23日

Problem Set 1 b

摘要: #Problem 2. #Write a program that computes the sum of the logarithms of all #the primes from 2 to some number n, #and print out the sum of the logs of the primes, #the number n, and the ratio of these two quantities. #Test this for different values of n. #You should be able to make only some small c 阅读全文

posted @ 2012-06-23 18:30 X.P.Chen 阅读(163) 评论(0) 推荐(0) 编辑

python求第1000个素数

摘要: #Problem Set 1 #Name: Jeff Chen #Description:Write a program that computes and prints the 1000th prime number. #Date:2012-6-22 from math import * i=0 for num in range(1,10000): isprime=True for j in range(2,int(sqrt(num))+1): if num%j==0&num!=j: isprime=False ... 阅读全文

posted @ 2012-06-23 12:37 X.P.Chen 阅读(319) 评论(0) 推荐(0) 编辑

导航