We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
A rational number q/r has a terminating decimal fraction if the equation
q/r=q'/10^k
holds for some integer q' and some natural number k.
If no such solution is possible the fraction will not terminate.
It helped me to look at the examples for M(11)=(11/4)^4 and M(8)=(8/3)^3 and test my assumptions why the corresponding equation had a solution (q', k) or not.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #183: Maximum product of parts
You are viewing a single comment's thread. Return to all comments →
A rational number q/r has a terminating decimal fraction if the equation
holds for some integer q' and some natural number k. If no such solution is possible the fraction will not terminate.
It helped me to look at the examples for M(11)=(11/4)^4 and M(8)=(8/3)^3 and test my assumptions why the corresponding equation had a solution (q', k) or not.