Skip to content

Commit 67f2a3c

Browse files
SwastyyPanquesito7
andauthored
Update bit_manipulation/count_of_trailing_ciphers_in_factorial_n.cpp
Co-authored-by: David Leal <halfpacho@gmail.com>
1 parent b6a8021 commit 67f2a3c

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

bit_manipulation/count_of_trailing_ciphers_in_factorial_n.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,9 @@
88
* that number. A factorial of a number N is a product of all numbers in the
99
range [1, N].
1010
11-
* We know that we get a trailing zero only if the number is multiple of 10 or
12-
has a factor pair (2,5). In all factorials of
13-
* any number greater than 5, we have many 2s more than 5s in the prime
14-
factorization of that number. Dividing a
15-
* number by powers of 5 will give us the count of 5s in its factors. So, the
16-
number of 5s will tell us the number of trailing zeroes.
11+
* We know that we get a trailing zero only if the number is multiple of 10 or has a factor pair (2,5). In all factorials of
12+
* any number greater than 5, we have many 2s more than 5s in the prime factorization of that number. Dividing a
13+
* number by powers of 5 will give us the count of 5s in its factors. So, the number of 5s will tell us the number of trailing zeroes.
1714
* @author [Swastika Gupta](https://github.com/Swastyy)
1815
*/
1916

0 commit comments

Comments
 (0)