2019-07-18 03:29:59 +02:00
|
|
|
from lib_prime import prime_factors_count
|
|
|
|
|
2019-07-17 03:17:21 +02:00
|
|
|
|
|
|
|
def euler_047():
|
2019-07-18 03:29:59 +02:00
|
|
|
s = []
|
|
|
|
for n in range(2, 1000000):
|
|
|
|
if len(prime_factors_count(n)) == 4:
|
|
|
|
s.append(n)
|
|
|
|
else:
|
|
|
|
s = []
|
|
|
|
if len(s) == 4:
|
|
|
|
return s[0]
|
2019-07-17 03:17:21 +02:00
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
print("e047.py: " + str(euler_047()))
|
2019-07-18 03:29:59 +02:00
|
|
|
assert(euler_047() == 134043)
|