进阶之路

导航

2018年4月27日 #

Problem 10: Summation of primes

摘要: def primeslist(max): ''' 求max值以内的质数序列 ''' a = [True]*(max+1) a[0],a[1]=False,False for index in range(2, len(a)): if a[index]==True: for i in range(index+i... 阅读全文

posted @ 2018-04-27 11:16 中年小Q 阅读(113) 评论(0) 推荐(0) 编辑

Problem 9: Special Pythagorean triplet

摘要: flag = 0 for a in range(1,1000): for b in range(a+1,1000): if a*a + b*b == (1000-a-b)**2: print(a,b) flag = 1 break if flag == 1: break pr... 阅读全文

posted @ 2018-04-27 11:12 中年小Q 阅读(106) 评论(0) 推荐(0) 编辑

Problem 7: 10001st prime

摘要: By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13. What is the 10 001st prime number? 阅读全文

posted @ 2018-04-27 11:09 中年小Q 阅读(120) 评论(0) 推荐(0) 编辑

Problem 8: Largest product in a series

摘要: 先粘实现代码,以后需要再慢慢补充思路 阅读全文

posted @ 2018-04-27 11:05 中年小Q 阅读(151) 评论(0) 推荐(0) 编辑