Solve task

This commit is contained in:
2020-10-12 20:39:14 +02:00
parent 20933b4f16
commit ddc4943f57

View File

@@ -1,4 +1,16 @@
for i in range(1,1000):
x = 1/i numsWithRecurringCycles = [n for n in range(2,1000) if n % 2 != 0 and n % 5 != 0]
def digits(num, divisor):
x = num
storedSums = []
while not x*10 in storedSums:
x *= 10
storedSums.append(x)
x %= divisor
return len(storedSums)
digitNumList = [digits(1, n) for n in numsWithRecurringCycles]
print(numsWithRecurringCycles[digitNumList.index(max(digitNumList))])