[Tutor] Finding a repeating sequence of digits
Robert Berman
bermanrl at cfl.rr.com
Sat Jan 2 03:01:13 CET 2010
Hi,
I am trying to build an algorithm or methodology which will let me tell
if a decimal has a repeating sequence of digits and if it does have that
attribute, what is the sequence of digits. For example, 1/3.0 =
0.333333333..By eyeballing we know it has a repeating sequence and we
know that the sequence is .3333.....A little more complex is 1/7.0 =
0.142857142857 but still is equivalent. A harder example is 45/56.0 =
0.8035714285714286. Here we have a repeating sequence but it comes after
the first three digits.
What I am looking for are ideas and suggestions looking for patterns. I
do know I should use a relatively large precision as repeating values
may constitute a rather long sequence. I did see, on Google, a
suggestion to use a precision of 1000.
Thank you for any and all ideas and suggestions.
Robert Berman
More information about the Tutor
mailing list