Valdescat wrote:

Zarrolou wrote:

Yes, that's correct.

Whenever you are asked for the trailing zeros of a given integer, just find the total number of 2-5 pairs.

So total trailing zeros of 43! is 9 for example:

40*...*35*...*30*..*25*...*20*...*15*..*10*..*5 they have 9 fives (25 has 2) so there are 9 zeros.

Most of the times it's all about counting the 5s because the number of 2s will be greater

Hello! can you explain how you get the 9 zeros out of 43!?

the part i´m confused in is when you say (25 has 2)

i get it that you have 8 pairs of 5:

40...35..30...25...20...15..10...5 but this gives me just 8 =S

thank you!!

Breaking it down a little further: let's start with a simpler example. How many trailing zeroes are there in 25*24*23*22*21*20?

The number of zeroes will be the same as the number of 10s in that product. The only way to get a trailing zero is to multiply something by 10, after all.

To figure out how many 10s are in the product, you'd need to rearrange it slightly. A 10 is composed of a 5 and a 2. So, you'll want to check how many 5s and 2s there are in the product. Rewrite the product to reflect this:

25*24*23*22*21*20

(5*5)*(2*2*2*3)*(23)*(2*11)*(3*7)*(2*2*5)

Notice that there are way more 2s than there are 5s. We'll run out of 5s before we run out of 2s. So, we really only need to count the 5s.

There are three of them in total:

(

5*

5)*(2*2*2*3)*(23)*(2*11)*(3*7)*(2*2*

5)

You can stop there, and just say 'okay, so there are 3 trailing zeroes'. But here's the deeper explanation of why that's the case. You could put the product in a slightly different order: pair each of those 5s with a 2. That's allowed, because when you're multiplying, it doesn't matter what order you multiply things in.

(5*5)*(2*2*2*3)*(23)*(2*11)*(3*7)*(2*2*5)

(

5*

5)*(

2*

2*

2*3)*(23)*(2*11)*(3*7)*(2*2*

5)

5*

2 *

5*

2 *

5*

2 * 3 * 23 * 2 * 11 * 3 * 7 * 2 * 2

10 * 10 * 10 * 3 * 23 * 2 * 11 * 3 * 7 * 2 * 2

There are your three 10s, so you've definitely got three trailing zeroes. To check the math, you can plug that multiplication into a calculator and confirm that (5*5)*(2*2*2*3)*(23)*(2*11)*(3*7)*(2*2*5) comes out the same as

10 * 10 * 10 * 3 * 23 * 2 * 11 * 3 * 7 * 2 * 2.

There's no need to do all of this when you actually do a terminating zeroes problem on test day, though. The 'shortcut' is just to count the powers of 5. But notice how when we multiplied everything out, 25 contributed

two fives? That means you need to count 25 twice. Anything that's a product of multiple fives (for example, 250 = 5*5*5*2), you'll need to count all of them separately.

_________________