All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Algorithms
Number of Zero Digits (Posted on 2024-04-07) Difficulty: 3 of 5
Derive an algorithm to calculate the total number of zeros in the decimal expansion of 20242024.

See The Solution Submitted by K Sengupta    
Rating: 5.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
One line algorithm | Comment 2 of 3 |
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
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (13)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information