Brain Teasers are Back!

Well done Mike, good that you know the size of a tennis court :sunglasses:

1 Like

I get 12, being the sum of the individual digits of each number on the preceding line.

2 Likes

Nicely done Mike.

Did you get 15 first ? (and wonder about the 7) Or did you get 12 straight away ?

1 Like

I’d read the discussion of the rouge 15 just after I got 15 myself :sunglasses:. I hadn’t actually checked the 7, as I thought I had the pattern working down the diagram.

Nothing, nothing, nothing …

4! is 4 x 3 x 2 x 1 = 24
10! is 10 x 9 x 8 x 7 x 6 x 5 x 4 x 3 x 2 x 1 = 3,628,800
100! is 100 x 99 x 98 x 97 x … x 2 x 1 = a very big number with lots of zeros at the end of it.

Well, exactly how may zeros does the number 100! have at the end of it ?

PS I found this one to be a toughie. So I won’t be surprised if there is ‘zero’ response :sunglasses:

I’ll go with 24.

2 Likes

@jrhardee’s answer looks good to me. I hope to see the rationale or workings.

I had an unfair advantage on this teaser as a recent project of mine was to see how big an exact factorial I could get on my old 2014 desktop PC. I got to 4,400,000,000! which was almost at the maximum 16GB limit in length (about 41 billion decimal figures).

The direct relevance to this teaser is that I needed to work out exactly how many trailing binary zeroes there were in the answer: 4,399,999,991, which allowed me to save 0.55GB of memory without losing exactness.

Mrs R reckons I should get out more.

1 Like

Morning JR. Well done, 24 it is!

I noticed your earlier post in which you were well and truely on the correct path in explaining your method. It’s a difficult one to explain, at least IMHO. I’ll leave it for a day or two in the hope that someone is willing to post their version. My version, similar to yours, involves counting factors of 10 and 5.

:sunglasses:

I’ll give other people a shot, but I can chime in later if needed.

1 Like

Sounds like a good plan.

It might keep one or two forum members busy and therefor out of trouble for the weekend :sunglasses:

Not me - I’ve been told to get out more!

1 Like

As there are plenty enough factors of 2 (for example there are 50 even numbers), we don’t need to count them. Instead just count the 5’s and combine each with a convenient 2.

There are 20 multiples of 5 up to 100, namely: 5, 10, 15… 95, 100.
There are 4 multiples of 25, namely: 25, 50, 75, 100. Each gives a second factor of 5.

Hence 24 overall. I’m sure there are other approaches too.

Follow up teasers:

How many zeros are there at the end of 1,000! What about 10,000!

What pattern is emerging?

Been busy this week.
Initial thoughts are all done in my head, so will look more closely over the next day or so.

Starting with 10!
2
20 + 4
200 + 40 + 8
2000 + 400 + 80 + 16
20000 + 4000 + 800 + 160 + 32

Basically multiply previous row by ten, add new number by dividing penultimate number by five.
But as I say, need to check.

Don,

You are on the right lines, subject to your checks and any refinements.

It would be worth calculating the sum for each n. How do they relate to n?

Anyone else have any thoughts/observations?

OK, a bit more thought together with pencil and paper has generated a bit more of a pattern …

2
20 + 4
200 + 40 + 8 + 1
2000 + 400 + 80 + 16 + 3
20000 + 4000 + 800 + 160 + 32 + 6 + 1
200000 + 40000 + 8000 + 1600 + 320 + 64 + 12 + 2
2000000 + 400000 + 80000 + 16000 + 3200 + 640 + 128 + 25 + 5 + 1

2
24
249
2499
24999
249999
2499999

However, the sharp-eyed will have noticed a slight discrepancy on one of the lines. And I haven’t yet been able to resolve it. It’s a bit like the $1 million question !!

1 Like

Nicely done! Your algorithm looks spot on.

And you spotted the curious feature in the pattern too.

I can’t offer a $1 million dollar prize but I think I will wait awhile to give a chance for pondering further.

I know the original teaser dealt with zeros (i.e. factors of 10) in 100! but the algorithm works for any prime factors of any n! each with a pattern. Not that I’m trying to extend the teaser even further that is.

OK,
A good approximation to the number of trailing zeros in X! is “one less than X/4”

So, for 100! that would be 100/4 =25, then deduct 1 giving 24
For 1,000! we would have 1000/4 = 250 then deduct 1 giving 249
For 10,000! we would find 10,000/4 = 2,500 then deduct 1 leaving 2499
etc
etc

PS. I’m guessing that for 60! the number of trailing zeros would be 60/4 = 15 then deduct 1 giving 14 as the answer.

PPS. Doesn’t work very well for small values of “X”

1 Like

That’s a pretty good approximation. It is always “slightly less than X/4” and there is a way of expressing “slightly less” directly from a formula, but it is far from obvious. By the way, “one less” is fairly common when X is a nice round number (e.g. try your numerical algorithm with X=624)

Any thoughts on why the factors of 5 would add up so close to X/4?

the number of factors of 5 in X! can be deduced by successive division by 5 starting with X

X/5 + X/(5x5) + X/(5x5x5) … to infinity
Putting X = 1 the answer is 0.25 ie 1/4 (or X/4) [Back to progressions !!]

put in X = 100 and we are back to the initial teaser with X/4 = 25.
(Discount all the elements of the progression that are less than 1, and you get 24. (ie the initial teaser)

100/5 = 20
20/5 = 4
4/5 = 0.8 (less than 1, so discard)
Answer to teaser = 24.

1 Like