尝试猜测一个合理的上界(比如一百万),再用筛法生成质因数数量表,找出其中满足要求的最小值即可,结果是$134043$。
target=1000000
d=[0]*target
n=2
while n < target:
for i in range(n,target,n):
d[i]+=1
n+=1
while n < target and d[n]>0:
n+=1
print min(i for i in range(target-3) if all(d[j]>=4 for j in range(i,i+4)))
|