Derive an algorithm to calculate the total number of zeros in the decimal expansion of 2024
2024.
Python apparently does integer math to an extreme length:
print(str(2024**2024).count('0'))
Output: 705
(2024^2024 is 6692 digits long, so 0 makes up about 10.5% of its digits.)
But I thought quite a bit about the question and could not think of any algorithm that was not essentially the same as doing multiplication many times.
|
Posted by Larry
on 2024-04-07 13:53:07 |