Here is an easy one...
It is not difficult to count the number of digits of the factorial of a given number. For example for 'n = 10', we have:
>> length(num2str(factorial(10)))
>> ans =
7
But 2 of those digits are just trailing zeros. So, for 10!, if we remove the trailing zeros, there would only be 5 digits left.
Write a function that outputs the number of digits of factorials excluding trailing zeros.
Solution Stats
Problem Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers20
Suggested Problems
-
Return the largest number that is adjacent to a zero
5525 Solvers
-
Project Euler: Problem 9, Pythagorean numbers
1397 Solvers
-
5917 Solvers
-
Big numbers, least significant digits
108 Solvers
-
Double all elements in the array
2354 Solvers
More from this Author116
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!