Some numbers (such as 4) have reciprocals with terminating decimal expansions, while others (such as 7) do not. Write a function that counts the numbers less than or equal to the input number whose reciprocals have terminating decimal expansions. For example, given 10, your function should return a count of 6, which corresponds to 1, 2, 4, 5, 8, and 10.
Solution Stats
Problem Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers16
Suggested Problems
-
Find all elements less than 0 or greater than 10 and replace them with NaN
15815 Solvers
-
Count from 0 to N^M in base N.
241 Solvers
-
451 Solvers
-
Back to basics 23 - Triangular matrix
1143 Solvers
-
98 Solvers
More from this Author328
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!