According to Midy’s theorem, if the period of a repeating decimal for , where p is prime and is a reduced fraction, has an even number of digits, then dividing the repeating portion into halves and adding gives a string of 9s. For example 1/7 = 0.14285714285.. is a repeating decimal with 142857 being repeated. Now, according to the theorem, it has even number of repeating digits i.e. 142857. Further if we divide this into two halves, we get 142 and 857. Thus, on adding these two, we get 999 which is string of 9s and matches our theorem.
In Extended Midy’s theorem if we divide the repeating portion of a/p into m digits, then their sum is a multiple of 10m -1.
Suppose a = 1 and p = 17,
a/p = 1/17 = 0.0588235294117647…
So, 0588235294117647 is the repeating portion of the decimal expansion of 1/17. Its repeating portion has 16 digits and it can be divided into m digits where m can be 2, 4, 8.
If we consider m = 4 then 0588235294117647 can be divided into 16/4 = 4 numbers and if we add these 4 numbers then result should be a multiple of 104 – 1 = 9999 i.e,
0588 + 2352 + 9411 + 7647 = 19998 = 2*9999
Repeating decimal = 0588235294117647 588 2352 9411 7647 Extended Midy's theorem holds!
- Euclidean algorithms (Basic and Extended)
- Rosser's Theorem
- Nicomachu's Theorem
- Fermat's Last Theorem
- Midy's theorem
- Fermat's little theorem
- Wilson's Theorem
- Corollaries of Binomial Theorem
- Hardy-Ramanujan Theorem
- Euclid Euler Theorem
- Compute nCr % p | Set 3 (Using Fermat Little Theorem)
- Compute nCr % p | Set 2 (Lucas Theorem)
- Lagrange's four square theorem
- An application on Bertrand's ballot theorem
- Chinese Remainder Theorem | Set 1 (Introduction)
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.