@@ -0,0 +1,860 @@
+# Problem 26 - Reciprocal cycles%0A# A unit fraction contains 1 in the numerator. The decimal representation of%0A# the unit fractions with denominators 2 to 10 are given:%0A#     1/2 =   0.5%0A#     1/3 =   0.(3)%0A#     1/4 =   0.25%0A#     1/5 =   0.2%0A#     1/6 =   0.1(6)%0A#     1/7 =   0.(142857)%0A#     1/8 =   0.125%0A#     1/9 =   0.(1)%0A#     1/10    =   0.1 %0A# Where 0.1(6) means 0.166666..., and has a 1-digit recurring cycle. It can be %0A# seen that 1/7 has a 6-digit recurring cycle.%0A# Find the value of d %3C 1000 for which 1/d contains the longest recurring cycle%0A# in its decimal fraction part.%0Adef cycle_longth(n):%0A    while not n %25 2:%0A        n /= 2%0A    while not n %25 5:%0A        n /= 5%0A    i = 1%0A    while (10**i-1) %25 n:%0A        i += 1%0A    return i%0Alongest_d = 2%0Afor d in range(2, 1000):%0A    if longest_d %3C cycle_longth(d):%0A        longest_d = d%0Aprint longest_d%0A

Create 26.py