Added python file for 26, thinking about approach

This commit is contained in:
2020-04-17 13:12:57 +02:00
parent 6708bd6865
commit b4c8909835

8
26/main.py Normal file
View File

@@ -0,0 +1,8 @@
# Find the number d < 1000 for which 1 / d has the longest recurring cycle
# in its decimal fraction part
# Observation: I first thought we only need to check prime numbers, but
# that is not the case. For example, 1/21 has a cycle of length 7, longer
# than both 3 and 7, but exactly the same as the cycles of 3 and 7 combined.
# But for 1/49 it has a cycle of length 42, so I don't think there is a
# clever way to deduce the length of the cycles without calculating them