Added python file for 26, thinking about approach
This commit is contained in:
8
26/main.py
Normal file
8
26/main.py
Normal 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
|
||||||
Reference in New Issue
Block a user