Created
July 1, 2022 17:07
-
-
Save fl3xice/a09ff382340b8e27858f03a4444337be to your computer and use it in GitHub Desktop.
Counting numbers of zeros
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function countZeros(n: number) { | |
let count = 0; | |
let l = 2; | |
for (let i = 5; i < Math.pow(n, n); i = Math.pow(i, l), l++) { | |
const s = n / i; | |
if (s % 1 > 0) { | |
break; | |
} | |
count += s; | |
} | |
return count; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment