Problem 273. Recurring Cycle Length (Inspired by Project Euler Problem 26)
Solution Stats
Problem Comments
-
2 Comments
sorry everyone, there was an issue in my reference solution used to generate the test suite. I have corrected this now.
where is the solutions
Solution Comments
-
1 Comment
Java + Signal processing aproach.
-
1 Comment
Ah feeling a little guilty :| ...
-
4 Comments
Unless my math (or counting) is wrong, the result of 1/17 by long division has a 16-digit (not 15) recurring cycle. I cannot find an error in my code or hand calculations. Any help?
I believe you are right, the current test results seem to use something similar to the current leading method which disregards the effect of 0's so it typically underestimates the cycle length when d>10...
I believe in the test problems the cycle lengths of 17,19,197,1977,12345 should be 16,18,98,658,822 instead...
And those are precisely the numbers I am getting.
Wikipedia agrees with you: http://en.wikipedia.org/wiki/Repeating_decimal#Cyclic_numbers
Problem Recent Solvers86
Suggested Problems
-
14053 Solvers
-
6416 Solvers
-
Change the sign of even index entries of the reversed vector
383 Solvers
-
Reverse the elements of an array
778 Solvers
-
Find the sides of an isosceles triangle when given its area and height from its base to apex
1085 Solvers
More from this Author56
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!