Triangle and numbers

The image shows a triangular formation of circles, where the top row has numbers 1 through 8. The circles in subsequent rows each have the product of the two numbers above it. For example, below the 2 2 and 3 3 is 2 × 3 = 6. 2\times 3 = 6.

How many trailing zeros will the number at the bottom have?


The answer is 35.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

12 solutions

Pranav Pant
Feb 16, 2018

The values in the second row and thereafter denote the number of zeroes present in that number.

Can you say that you look at the row, where the first trailling zero appears and then do the same operation as how it is formed? As long as you reach the end point at the bottom? (Otherwise I could also imagine that somewhere down the road a 0 is appearing from some previously neglected path...?)

The only way in the rhythm to get a zero, is by multiplying 4 times 5 and 5 times 6.

Can you also do written multplication and move on a step if a number other than zero appears on the left of the end result of your written multiplication?

Julia Seidel - 3 years, 3 months ago

Log in to reply

A zero appears when you have a multiple of 10. 10 is only formed with its factors 2 and 5. Since 2 can appear from 2,4,6, and 8 you will most certainly have more 2's than 5's so OP only tracks 5's. Your question " a 0 is appearing from some previously neglected path" is not going to happen because you would have to neglect a 5.

If the seed row had two more entries, 9 and 10, then that 10 would contribute a factor of 5 as well, for example. Maybe that is what you are asking. Then you would track those down as well.

salvador razo - 3 years, 3 months ago

That is a neat and nice technique...

Ossama Ismail - 3 years, 3 months ago

Very nice presentation.

For completeness, you should also track the number of powers of 2, though it is almost obvious that there will be more powers of 2 than powers of 5.

Calvin Lin Staff - 3 years, 3 months ago

Log in to reply

I don't that you need to check the powers of 2, as the second row has no numbers that end in 5. If there were numbers like this, then extra trailing 0s would be added.

Ojas Gulati - 3 years, 3 months ago

Log in to reply

Good observation for this scenario - we only need to account for the trailing 0's from the second line onwards.

Though, if we extended this to (say) 126 rows, then we will have to be careful with accounting. (Though, maybe the third row onwards will be all 0's)

Calvin Lin Staff - 3 years, 3 months ago

Brilliant!

ZHI SHU - 3 years, 3 months ago

Just the way I thought of 😁😁

BRINTHA COSMOS - 3 years, 3 months ago

1 2 3 4 5 6 7 8
2 6 12 20 30 42 56
12 72 240 600 1260 2352
864 17280 144000 756000 2963520
14929920 2488320000 1.08864E+11 2.24042E+12
3.71504E+16 2.70888E+20 2.43901E+23
1.00636E+37 6.607E+43
6.64904E+80
Using a spreadsheet to work down the calculations this is what I get. So I don't understand where you get 35. Maybe like a lot of the questions in this forum it is not clear what the question is!


Mike Egan - 3 years, 3 months ago

Log in to reply

I think the question is clearly stated. Perhaps you are confusing the concepts of "How many digits does a number have" and "How many digits are there at the end of a number". For example, 10 ! = 3628800 = 3.628800 E + 6 10! = 3628800 = 3.628800 E+6 has 7 digits and 2 of them are trailing zeroes.

The spreadsheet multiplication tells us that the last number has exactly 81 digits.
I see that the 7th digit from the left is not 0, so there are at most 81 7 = 74 81 - 7 = 74 trailing zeros.
How many trailing zeros do you think there are?

Calvin Lin Staff - 3 years, 3 months ago

before reading what you said i was like 𝟒 𝐭𝐢𝐦𝐞𝐬 𝟓 𝐢𝐬 𝐧𝐨𝐭 𝟏

Joseph Costello - 3 years, 3 months ago

I worked it in the same way! I love the visual solutions!

Roman Josue de las Heras Torres - 3 years, 3 months ago

exactly how i solved it

Matthew Carreiro - 3 years, 3 months ago

Isn´t this Pascals triangle, but cut out?

Erik Sparr - 3 years, 2 months ago
Arjen Vreugdenhil
Feb 25, 2018

The number of trailing zeroes is the number of factors 10 = 2 5 10 = 2\cdot 5 present; since there are many more even numbers than factors 5 in the problem, the number of trailing zeroes is equal to the number of factors 5 .

Since each factor 5 must eventually come from the "5" at top, we must consider how many pathways there are from the "5" to the bottom circle .

Each of these pathways consists of 4 steps "southwest" and 3 steps "southeast". Therefore the number of pathways, and thus the number of trailing zeroes, is ( 7 3 ) = 7 6 5 3 2 1 = 7 5 = 35 . \binom 7 3 = \frac{7\cdot 6\cdot 5}{3 \cdot 2 \cdot 1} = 7 \cdot 5 = \boxed{35}.

The quickest solution

Pau Cantos - 3 years, 3 months ago

Brilliant!

ZHI SHU - 3 years, 3 months ago

didn't understand the 7 and the 3

Shady Kahaleh - 3 years, 3 months ago

Log in to reply

There are 7! Possibilities (paths) from the 5 to the bottom as your numerator but you then have to divide out all the possibilities going "southeast" and "southwest" of which there are 4! And 3!. Thus you have 7!/4!3! = 7x6x5/3x2x1 = 7x5 = 35.

Lee J. - 3 years, 3 months ago

I can't understand your solution.can anyone help?

BRINTHA COSMOS - 3 years, 3 months ago

I understand the 7, that's the number of steps it takes to get from to the bottom, starting with 30, 3 to the right, then starting with 20, 4 to the left. 4 to the left, then 3 to the right. I also understand the concept of trailing zeros as factors of 10. That said, I too am unclear we're the 3 is coming from and how your solving (7 3) to (7•6•5)/(3•2•1). Admittedly, I'm a little rusty which is why I started using this app! Thanks in advance for a little more explanation for those of us dusting off the rust. ;-)

Dominick Tornabene - 3 years, 3 months ago

Log in to reply

It takes seven steps to get from the top "5" to the bottom circle. Three of the seven steps are "southeast". The question is thus: in how many different ways can we choose three out of seven steps? That is, how many combinations are there of 3 out of 7?

For the answer, consider that

  • we have 7 possibilities to choose the first "southeast",

  • 6 possibilities left to choose the second,

  • 5 possibilities to choose the third,

resulting in 7 6 5 7\cdot 6\cdot 5 choices. However, we now have every solution six ( 3 2 1 3\cdot 2\cdot 1 ) times, because it does not matter which "southeast" we choose first, second, or third. Therefore we divide: 7 6 5 3 2 1 = 7 ! 3 ! 4 ! = : ( 7 3 ) . \frac{7\cdot 6\cdot 5}{3\cdot 2\cdot 1} = \frac{7!}{3!4!} =: \binom 7 3.

Arjen Vreugdenhil - 3 years, 3 months ago

Great solution!

Marina Longnickel - 3 years, 3 months ago

Great solution. But it isn't just that there are more 2 even numbers than multiples of 5; all then number from the second row on are even. So the 5 in the top row is the only odd multiple of 5.

Robert Beggs - 3 years, 3 months ago

Log in to reply

Let me reword that. (Can't seem to edit my own comment once it's posted.) It isn't just that there are more even numbers than factors 5; each factor 5, except the one in the top row, has a factor 2 to pair with it.

Robert Beggs - 3 years, 3 months ago

Inspiring solution, as always!

Uros Stojkovic - 3 years, 3 months ago

Elegant solution.

Elizandro Max - 3 years, 3 months ago
David Vreken
Feb 16, 2018

The second row will be ( 1 1 2 1 , 2 1 3 1 , 3 1 4 1 , 4 1 5 1 , 5 1 6 1 , 6 1 7 1 , 7 1 8 1 ) (1^12^1, 2^13^1, 3^14^1, 4^15^1, 5^16^1, 6^17^1, 7^18^1) , the third row will be ( 1 1 2 2 3 1 , 2 1 3 2 4 1 , 3 1 4 2 5 1 , 4 1 5 2 6 1 , 5 1 6 2 7 1 , 6 1 7 2 8 1 ) (1^12^23^1, 2^13^24^1, 3^14^25^1, 4^15^26^1, 5^16^27^1, 6^17^28^1) , the fourth row will be ( 1 1 2 3 3 3 4 1 , 2 1 3 3 4 3 5 1 , 3 1 4 3 5 3 6 1 , 4 1 5 3 6 3 7 1 , 5 1 6 3 7 3 8 1 ) (1^12^33^34^1, 2^13^34^35^1, 3^14^35^36^1,4^15^36^37^1, 5^16^37^38^1) , and so on. We can observe that the pattern of exponents for each digit follows the numbers of Pascal's Triangle , since the exponents for each digit is the sum of the exponents of the digits in the line before. Therefore, the final number will be 1 1 2 7 3 21 4 35 5 35 6 21 7 7 8 1 1^12^73^{21}4^{35}5^{35}6^{21}7^78^1 , and since 5 35 5^{35} is the greatest factor that is a multiple of 5 5 , and 2 35 2^{35} is also a factor (from 4 35 4^{35} ), 1 0 35 10^{35} is the greatest factor that is a multiple of 10 10 , so the final number ends in 35 \boxed{35} zeros.

Nice answers, but all wrong. If you multiply it all out, here's the result, in csv form:

1,2,3,4,5,6,7,8 2,6,12,20,30,42,56 12,72,240,600,1260,2352 864,17280,144000,756000,2963520 14929920,2488320000,108864000000,2240421120000 37150418534400000,270888468480000000000,243901204807680000000000 10063619980174600000000000000000000000,66070023830779200000000000000000000000000000 664903611914043000000000000000000000000000000000000000000000000000000000000000000 which has 66 trailing zeroes

Hans Kruiniger - 3 years, 3 months ago

Log in to reply

Whatever you are using to calculate these numbers is rounding your last three large numbers: 10063619980174600000000000000000000000 should be 10063619980174622195712000000000000000, 66070023830779200000000000000000000000000000 should be 66070023830779248141926400000000000000000000, and 664903611914043000000000000000000000000000000000000000000000000000000000000000000 should be 664903611914043473202543232567979684173499596800000000000000000000000000000000000.

David Vreken - 3 years, 3 months ago

Log in to reply

I hate to say that I did it out using "brute force", but when you have a computer, that is an option. I am getting what Hans is getting. I am working on a more elegant way of determining the outcome.

Nicholas Chocas - 3 years, 3 months ago

Log in to reply

@Nicholas Chocas I first did it the above way (looking at the pattern of exponents). But then after reading Hans's comment I double-checked it on a computer using Python.


# Triangles and Numbers
# Python 2.7.3
t = []
t.append([1, 2, 3, 4, 5, 6, 7, 8])
print t[0]
for a in range(1, len(t[0])):
    t.append([])
    for b in range(0, len(t[a - 1]) - 1):
        t[a].append(t[a - 1][b] * t[a - 1][b + 1])
    print t[a]

David Vreken - 3 years, 3 months ago

Your calculation is not accurate, since it was rounded, here is mine with java: 2 6 12 72 864 17280 14929920 2488320000 37150418534400000 270888468480000000000 10063619980174622195712000000000000000 66070023830779248141926400000000000000000000 664903611914043473202543232567979684173499596800000000000000000000000000000000000 (35 zeros)

Benny BK - 3 years, 3 months ago
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
x = [x for x in range(1,9)]
print ",".join(str(i) for i in x)
y = []
while len(x) > 1:
    for k,i in enumerate(x[:-1]):
        y.append(x[k]*x[k+1])
    x = y
    y = []
    z = ",".join(str(i) for i in x)
    print z
print 'Trailing zeros = %d' %(len(z) - len(z.rstrip('0')))

1
2
3
4
5
6
7
8
9
1,2,3,4,5,6,7,8
2,6,12,20,30,42,56
12,72,240,600,1260,2352
864,17280,144000,756000,2963520
14929920,2488320000,108864000000,2240421120000
37150418534400000,270888468480000000000,243901204807680000000000
10063619980174622195712000000000000000,66070023830779248141926400000000000000000000
664903611914043473202543232567979684173499596800000000000000000000000000000000000
Trailing zeros = 35

To find the value of the bottom circle, first, I tried to simplify the problem. With one number, a a , the value of the bottom circle a a ; With two numbers, a a and b b , its value is a b ab ; With three numbers, its value is a b 2 c a{ b }^{ 2 }c ; With four number, a b 3 c 3 d a{ b }^{ 3 }c^{ 3 }d ;... We can realize that the power of each number in each pattern, from left to right, corresponds to the numbers in Pascal's triangle. Hence, we can calculate the value of the bottom circle in the picture: it equals to 1 1 × 2 7 × 3 21 × 4 35 × 5 35 × 6 21 × 7 7 × 8 1 { 1 }^{ 1 }\times { 2 }^{ 7 }\times { 3 }^{ 21 }\times { 4 }^{ 35 }\times { 5 }^{ 35 }\times { 6 }^{ 21 }\times { 7 }^{ 7 }\times { 8 }^{ 1 } . However, we are only caring​ about the number of trailing zeros, so we can remove the prime factors that are neither 2 nor 5. We get 2 101 × 5 35 { 2 }^{ 101 }\times { 5 }^{ 35 } . Since 101 > 35 101>35 , there are 35 trailing zeros in the number at the bottom.

Sự Trần
Mar 1, 2018

see below for the trailing 0 for each number of each row

Such an elegant solution

Alvaro Vilela - 3 years, 3 months ago

Log in to reply

i disagree you little *

Adi Peetush - 3 years, 2 months ago

Not a solution, but a question...how do we not know whether or not other products, or child products, when multiplied together, will also give a number with a trailing zero? I've looked at the times tables to see that indeed, only numbers which are multiples of 5 or 10 result in numbers with trailing zeroes, but I would deem this a little too naive. Or am I looking at this the wrong way?

Well, any number with a trailing zero can have a 10 factored out of it, right? Which means that the only numbers with trailing zeroes are numbers that are a multiple of 10. And since 10, when factored out, is 2x5, the only numbers with trailing zeroes are numbers that are multiples of both 2 and 5. So that’s how we know other “child products”, which do not involve both 2 and 5, will not have any trailing zeroes. Does that make sense?

Jenny Tang - 3 years, 3 months ago

The amount of trailing zeroes is equal to the least between the amount of factors of 5 and 2.

there are many more factors of 2 than 5 (4 has two factors of 2 and its placed symmetrically in the triangle compared to 5

Then its only a matter of realising the amount of factors of 5 in each number form a pascal's triangle. Since you multiple two adjacent numbers, you multiply the factors, which means the amount of factors increase additively.

Going doing the triangle shows the final spot coincides with 35, thus that is our answer.

Abe Binder
Feb 28, 2018
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
a=[1,2,3,4,5,6,7,8]
    while(len(a)>1):
        b=[]
        for i in range(0, len(a)-1):
            b.append(a[i]*a[i+1])
        a=b
    counter=0
    while(a[0]%10==0):
        a[0]=a[0]//10
        counter+=1
    print(counter)

A Python scripting approach:

lines = [[x for x in range(1, 9)]]

while len(lines[-1]) > 1:
    lastline = lines[-1]
    newline = []

    for i in range(len(lastline) - 1):
        newline.append(lastline[i] * lastline[i + 1])

    lines.append(newline)

for line in lines:
    print(line)

lastvalue = str(lines[-1][0])

zeroes = 0

while lastvalue[-1] == '0':
    zeroes += 1
    lastvalue = lastvalue[:-1]

print('Zeroes:', zeroes)

This will output:

[1, 2, 3, 4, 5, 6, 7, 8]
[2, 6, 12, 20, 30, 42, 56]
[12, 72, 240, 600, 1260, 2352]
[864, 17280, 144000, 756000, 2963520]
[14929920, 2488320000, 108864000000, 2240421120000]
[37150418534400000, 270888468480000000000, 243901204807680000000000]
[10063619980174622195712000000000000000, 66070023830779248141926400000000000000000000]
[664903611914043473202543232567979684173499596800000000000000000000000000000000000]
Zeroes: 35

See https://github.com/alcibiade/brilliant/blob/master/2018-02-26/l2-problem3.py

If you multiply them you will get this.... 3,897,583,913,560,042,260,642,265,383,304,444,890,358,227,979,468,800,000,000,000,000,000,000,000,000,000,000,000 i did it on my phone

Giorgos K.
Feb 21, 2018

Mathematica

NestList[(Times@@@Partition[#,{2},1])&,Range@8,7]

gives
{1, 2, 3, 4, 5, 6, 7, 8}, {2, 6, 12, 20, 30, 42, 56}, {12, 72, 240, 600, 1260, 2352}, {864, 17280, 144000, 756000, 2963520}, {14929920, 2488320000, 108864000000, 2240421120000}, {37150418534400000, 270888468480000000000, 243901204807680000000000}, {10063619980174622195712000000000000000, 66070023830779248141926400000000000000000000}, {664903611914043473202543232567979684173499596800000000000000000000000000000000000}

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...