2008年(47)
分类:
2008-11-15 21:33:46
The first two consecutive numbers to have two distinct prime factors are:
14 = 2 7
15 = 3 5
The first three consecutive numbers to have three distinct prime factors are:
644 = 2² 7
23
645 = 3 5
43
646 = 2 17
19.
Find the first four consecutive integers to have four distinct primes factors. What is the first of these numbers?
chinaunix网友2008-12-08 14:19:27
你啥机器呀?fun47Quick在我机器上需要10s,改为如下后,运行时间为7s。 def forceResult(): limit=1000000 list=[0]*limit for i in range(2,limit-1): if list[i]==0: count=0 for tmp in range(2*i,limit-1,i): list[tmp]+=1 elif list[i]==4: count+=1 if count==4: return i-3 else: count=0