Number of Trailing/Leading Zeros in the Product of Consecutive Numbers
Quantitative Aptitude › Number System · Topic 1.16
The number of trailing zeros in a product equals the smaller of the number of factors 2 and the number of factors 5 in its prime factorization. For decimal fractions, leading zeros after the decimal point are found by writing the value in scientific form.
6 min read · Quantitative Aptitude · Number System
Quick Answer
The number of trailing zeros in a product equals the smaller of the number of factors 2 and the number of factors 5 in its prime factorization. For decimal fractions, leading zeros after the decimal point are found by writing the value in scientific form.
At a Glance
- Trailing zeros min(number of 2s, number of 5s)
- Usually limiting The number of 5s
- Exception Products made of multiples of 5 only
- Leading zeros Zeros after the point before the first non-zero digit
- Scientific form m × 10-k has k – 1 leading zeros
- 25 × 26 × … × 30 3 trailing zeros
Where Does It Fit?
This topic follows Finding a Number Satisfying Given Digit-Arrangement Conditions and generalises Factorial Values and Number of Trailing Zeros in a Factorial, where factorials were used. It uses powers of 2 and 5 from Number of Factors, Sum of Factors and Product of Factors of a Number and leads to the prime-power method of Highest Power of a Prime Number Dividing a Factorial.
How Do You Count Trailing Zeros in a Product?
In short: a trailing zero needs one factor 2 and one factor 5, so count both in the whole product and take the smaller count.
Rule
- Trailing zeros = min(power of 2, power of 5) in the product.
- For consecutive numbers, 5s are usually fewer than 2s, so count the 5s, but check the 2s when the numbers are all multiples of 5.
| Product | Power of 2 | Power of 5 | Trailing zeros |
|---|---|---|---|
| 25 × 26 × 27 × 28 × 29 × 30 | 4 | 3 | 3 |
| 5 × 10 × 15 × 20 × 25 | 3 | 6 | 3 |
| 210 × 57 × 3 | 10 | 7 | 7 |
| 11 × 12 × … × 20 | 8 | 2 | 2 |
In 25 to 30, the 5s come from 25 (two) and 30 (one), which is 3, and the 2s come from 26, 28 and 30, which is 1 + 2 + 1 = 4. So there are 3 zeros. In 5 × 10 × 15 × 20 × 25, the 5s total 6 but the 2s total only 3, so the 2s limit the zeros.
How Do You Find the Zeros of a Product of Consecutive Numbers?
In short: write the product as a ratio of factorials and use the factorial formula from Factorial Values and Number of Trailing Zeros in a Factorial.
- The product of the numbers from a to b is b!/(a – 1)!.
- Zeros in 15 × 16 × … × 25: the 5s are in 15 (1), 20 (1) and 25 (2), which is 4. The 2s are plenty, so there are 4 zeros.
- Zeros in 6 × 7 × 8 × 9 × 10: the 5s: only 10 gives one, so there is 1 zero.
How Do You Count Leading Zeros in a Small Decimal?
In short: write the value as m × 10-k with 1 ≤ m < 10; there are k – 1 zeros after the decimal point before the first non-zero digit.
| Value | Scientific form | Zeros after the point |
|---|---|---|
| (1/2)10 = 0.0009765625 | 9.77 × 10-4 | 3 |
| (0.5)20 = 0.00000095367… | 9.54 × 10-7 | 6 |
| (1/3)20 = 0.000000000286797… | 2.87 × 10-10 | 9 |
| 0.00001 | 1 × 10-5 | 4 |
For a power such as (1/2)n, the number of zeros after the point is the integer part of n × log10 2, which for n = 100 is 30. The related counting of digits with logarithms appears in Finding the Number of Digits in a Number Using Logarithms.
Solved Examples
Example 1
Question: Find the number of trailing zeros in 25 × 26 × 27 × 28 × 29 × 30.
- Powers of 5: 25 gives 2 and 30 gives 1, so 3.
- Powers of 2: 26 gives 1, 28 gives 2 and 30 gives 1, so 4.
- Zeros = min(4, 3).
Answer: 3.
Example 2
Question: Find the number of trailing zeros in 5 × 10 × 15 × 20 × 25.
- Powers of 5: 1 + 1 + 1 + 1 + 2 = 6.
- Powers of 2: 10 gives 1 and 20 gives 2, so 3.
- Zeros = min(3, 6). The product is 3,75,000.
Answer: 3.
Example 3
Question: Find the number of trailing zeros in 210 × 57 × 3.
- The power of 2 is 10 and the power of 5 is 7.
- Zeros = min(10, 7).
Answer: 7.
Example 4
Question: Find the number of trailing zeros in 15 × 16 × … × 25.
- Powers of 5: 15 gives 1, 20 gives 1, 25 gives 2, so 4.
- Powers of 2 are more than 4.
- Zeros = 4.
Answer: 4.
Example 5
Question: How many zeros come after the decimal point and before the first non-zero digit in (1/2)10?
- (1/2)10 = 1/1,024.
- 1/1,024 = 0.0009765625.
- Count the zeros after the point before 9: three.
Answer: 3.
Shortcuts and Tricks
- Count the 5s first; count the 2s only if the numbers are multiples of 5 or the 5s are many.
- Remember that multiples of 25 give two 5s and multiples of 125 give three.
- Write a product of consecutive numbers as b!/(a – 1)! to use the factorial formula.
- For leading zeros, use the integer part of -log10 of the value.
- Check small cases by listing the product.
Common Mistakes
- Ignoring the 2s when all numbers are multiples of 5.
- Counting each multiple of 5 as one 5 even when it is a multiple of 25.
- Counting zeros inside the number instead of at the end.
- Confusing zeros after the decimal point with the number of digits.
- Forgetting that 10 itself contributes one 2 and one 5.
Practice Questions
- How many trailing zeros are in 11 × 12 × … × 20?
- How many trailing zeros are in 6 × 7 × 8 × 9 × 10?
- How many trailing zeros are in 45 × 46 × … × 50?
- How many trailing zeros are in 26 × 27 × … × 35?
- How many zeros are after the decimal point in (0.5)20 before the first non-zero digit?
- How many digits does 2100 have?
Answers: 1) 2; 2) 1; 3) 3; 4) 2; 5) 6; 6) 31.
Why Is This Topic Important?
- Concept use Tests prime factors in a short question.
- Exam use Appears in many number system sets.
- Link Extends Factorial Values and Number of Trailing Zeros in a Factorial.
- Link Leads to Highest Power of a Prime Number Dividing a Factorial.
What Comes Next?
The next topic is Perfect Numbers, Perfect Squares and Perfect Cubes Identification, which identifies perfect numbers, perfect squares and perfect cubes.
Key Terms and Formulas
- Trailing zero A zero at the end of a number
- Leading zero A zero after the point before the first non-zero digit
- Scientific form m × 10k
- Power of 5 Count of 5s in the product
- Consecutive numbers Numbers that follow each other
- Limiting factor The smaller of the 2s and 5s
Related Topics
- Finding a Number Satisfying Given Digit-Arrangement Conditions
- Perfect Numbers, Perfect Squares and Perfect Cubes Identification
- Classification of Numbers (Natural, Whole, Integers, Rational, Irrational and Real Numbers)
- Face Value and Place Value of Digits
Exam Corner
Points to Remember
- Trailing zeros = min(number of 2s, number of 5s).
- Multiples of 25 give two 5s.
- Consecutive products: use b!/(a – 1)!.
- Leading zeros after the point = k – 1 for m × 10-k.
- Check the 2s when all numbers are multiples of 5.
Do Not Confuse With
- Trailing vs leading zeros Trailing zeros end a whole number; leading zeros follow the decimal point.
- Number of zeros vs digits Digits and zeros are different counts.
- Power of 2 vs power of 5 The smaller one sets the zeros.
- Factorial vs product of consecutive numbers A factorial starts from 1.
Memory Hook
Count twos and fives; the lesser gives the zeros.
GS Relevance
Frequently Asked Questions
How do you count trailing zeros in a product?
To count trailing zeros in a product, find the total number of factors 2 and the total number of factors 5 in its prime factorization, and take the smaller of the two counts. Each trailing zero needs one 2 and one 5. For 25 to 30 multiplied together, the answer is 3.
When do the factors of 2 limit the trailing zeros?
The factors of 2 limit the trailing zeros when the product has fewer 2s than 5s, which happens when the numbers are mostly odd multiples of 5. For 5 times 10 times 15 times 20 times 25, there are 6 factors of 5 but only 3 factors of 2, so the product has 3 trailing zeros.
How do you find trailing zeros in the product of consecutive numbers?
To find trailing zeros in the product of consecutive numbers from a to b, count the factors of 5 in the range, counting two for multiples of 25 and three for multiples of 125, and also check the 2s. For 15 to 25, the 5s are 1, 1 and 2, giving 4 zeros.
How do you count zeros after the decimal point in a small number?
Write the number in scientific form as m times 10 to the power negative k, with m between 1 and 10. The number of zeros after the point is k minus 1. For 1 over 1,024, about 9.77 times 10 to the power negative 4, there are 3 zeros.
How many digits does 2 to the power 100 have?
The number 2 to the power 100 has 31 digits. The number of digits of a power is the integer part of the exponent times the base 10 logarithm of the base, plus 1. Here 100 times 0.30103 is about 30.1, so the integer part is 30 and the digit count is 31.
PYQ Practice — Statement Analysis
1 The product 25 × 26 × 27 × 28 × 29 × 30 ends in 3 zeros.
The 5s total 3 and the 2s total 4.
2 Trailing zeros always depend only on the number of 5s.
If the 2s are fewer, they limit the zeros, as in 5 × 10 × 15 × 20 × 25.
3 210 × 57 has 7 trailing zeros.
The smaller power is 7.
4 (1/2)10 has 3 zeros after the decimal point before the first non-zero digit.
1/1,024 = 0.0009765625.
Related Topics
Browse the full Quantitative Aptitude index