Spiked Math Games  // Math Fail Blog  // Gauss Facts  // Spiked Math Comics



MPF - Triangles - February 24, 2012
Rating: 4.6/5 (77 votes cast)
  • Currently 4.6/5
  • 1
  • 2
  • 3
  • 4
  • 5
Today is Math Puzzle Friday (MPF), Yay!

If I ever make an IQ test the following question will be going on it.

Spiked Math Comic - Triangles

Be mathy!

home     info     archive     contact     rss

Google+ Page   //   Facebook Page   //   Twitter Page


Is it 784?

My bad, that's only small triangles.
I counted grey triangles on one side: 28. I didn't see a way around this with clever math. Let's look at the horizontal rows, of which there are 28. The bottom row has 28 (grey) + 27 (yellow) = 55 small triangles, the top row has 1 small triangle, for a total of 56 in these two rows. The next two rows (below the top, above the bottom) also have 56 small triangles, you can make this combination 28/2=14 times. So there are 14*56=784 small triangles. Now try to include all triangles!

28^2 + sum from i=1 to 27 of ((28-i)*i)
So... 4438

I think it's 1513. The formula seems to be 2x^2 - 2x + 1 (I haven't got a proof, I just drew the first four sized triangles and played around with differences until I got something).

Wait, oops, forgot >1 sized upside-down triangles.

Excellent work, TCoZ--we did the same thing!
It's funny seeing a visual representation of such a basic equation.

I think it's 5985

Yup, I have the same number, 5985.

5985 maybe ?

/\ triangles : sum of 28 first triangular numbers
\/ triangles : sum of odd-ranked triangular numbers (1st, 3rd, ..., 27th). The rank increases by two as if we start with an unique size downward triangle (first triangular number), each time we decrease the size by one, we have one more row "above" and another one "below".

Should get #/\ = 4060 and #\/ = 1925

Of course I meant "with an unique size 14 downward triangle"

But every other time, it's the even-ranked triangle numbers, not odd-ranked... I have a general formula. :)

Here's the formula I got from noticing the pattern after drawing several out:

number of triangles = n^2 + sum of triangular numbers up to n-1
= n^2 + n(n-1)(n+1)/6

So for for n=28 we get 28^2+28*27*29/6 = 4438.

"Upward-pointing" triangles: sum from n=1 to 28 (sum from k=1 to n k).
"Downward-pointing" triangles: sum from n=1 to 14 (sum from k=1 to n 2k-1).

Seems to be 5075.
Sum the above to acquire the total sum of triangles.

I think it might be 11,746.... but I make no promises.

The number of triangles in a triangular matchstick arrangement with n rows is given by floor(n(n+2)(2n+1)/8). See sequence A002717 in the Online Encylopedia of Integer Sequences for equivalent formulae and references.

The matchstick arrangement in the puzzle has 28 rows, so there are floor(28*30*57/8)=5985 triangles in total.

with n being the size of the largest triangle, i get
(2 n^2 + 5 n + 2)*n / 8 for even n and
(2 n^3 + 5 n^2 + 2 n - 1)/8 for odd n

I agree with 5985.
Calculated with a spreadsheet

Definitly 4438.


n(n+2)(2n+1)/8 , where n = 28 => 5985 triangles


I wonder where the 1/8th of a triangle is that this formula is counting for odd n.

5985, checked by counting ^_^

Ha ha ... lol ! How long did it take you?

I worked it out to as follows, though I didn't calculate it.

Upward pointing triangles: Each small grey triangle is a peak for k triangles where there are k rows below it, including itself. Thus, the triangle in row 1 is the peak of 28 triangles, the two in row 2 are the peaks of 27 each, etc. Therefore, the formula for upward pointing triangles is Sum from i=0 to n of [i(n-i+1)]. This intuitively starts with i=1, but the value is the same for i=0, and the next section makes more sense to start with i=0, so I did the same here.

Downward pointing triangles: Same idea, but a bit trickier, since they point the other way. Basically, each yellow triangle along the upper-left side is the peak (trough?) of one triangle. The same is true of the yellow triangles along the upper-right side, except we don't want to double count the top one. The next parallel line(s) of yellow triangles are each the peak of two triangles, aside from the ones in the third row, which we've counted. The formula for these is more complex. I split it into two sums, one for the upper-left triangles, one for the upper-right. I made sure not to double count, but you could re-derive it where you subtract the double-counts at the end, as well. Sum from i=0 to floor(n/2) of [i(n-2i+1)] + Sum from i=0 to floor((n-1)/2) of [i(n-2i)]. These start at i=0 so you don't wind up in a situation where you are taking a sum from i=1 to 0. It just makes more sense that way. :)

I'll trust earlier comments that the correct answer is 5985...

4060+1925=5985 really seems to be right.

Newfags can't triforce

I got 5985 from
Sum((x+1)C(x_1)*(1+(-1)^x)!) from 1 to N
For odd values of N (numbers of the smallest triangle's base as the largest triangle's base), and
Sum((x+1)C(x-1)*(1+(-1)^(x+1))!) from 1 to N
For even values of N
Maybe inefficient, took me a while, but thanks for the challenge, mike!

also... it can be reduced to
sum from n=1 to N of ((n^2+n)/2*(1+(-1)^(n+N))!)
for any N, leaving the same answer

1,3,5,13(?) ... haven't thought about this one, but it sure ougth to have a nice sequence reducing it to an already solved problem.

Let x be the base of one small triangle, and y be its height. Then the area of small triangle is (xy/2). Now, the base of large triangle is 28x, and its height 28y: hence its area= 392xy. Since Area is directly proportional to the number of triangles, find the ratio of the bigger area to the one traingle's area, which is 784, and therefore is the number of triangles. (If you don't agree, count them yourself).

that would be true, if three 'up' triangles forming a 'triforce' didn't form another triangle of area 2x*2y/2=xy and three of those an even larger one and then the triangle composed of 6 small 'up' triangles, and some of those combinations for downward triangles too, etc.
making a triforce:
▲ ▲

Get off the floor!
[2n^3+5n^2+2n-(n mod 2)]/8

for n = an even number of rows
sum for x=1 to n of (x^2+x)/2 upright triangles
sum for x=1 to (n/2) of (2x^2-x) upside down triangles
for 28 rows: 4060+1925=5985 total

more generally: for n (even) rows and triangle of height m
(n-m+1)th triangular number of upright triangles for m=<n
(n-(m/2)+1)th triangular number of upside down triangles for m=<(n/2)

5985, I think.

I concur with 5985, with (1/2)sum(i=1 to N)sum(n=1 to N-i+1)(3+(-1)^i)n for N=28.

its definitely 5985 + the 5 in the example box
so there is a total of 5990 triangles :)

Okay, so how many regular hexagons are there?

I got 1215 for the number of regular hexagons. I found that it will be equal to T(23)+T(20)+T(17)+T(14)+T(11)+T(8)+T(5)+T(2).

Here is a python script to do this: http://pastebin.com/z5KCcqDP

Got 5985 as well!

It's funny how there seemed to be an overwhelming consensus about the answer being 5985, and yet being a mathematician I still had to see for myself. And although I did get the same answer I would say my time was still well spent.

I forgot to add +T(26). The number is still 1215.

I got 536870909 counting equilateral triangles of all sizes. Not sure though.

x(n) = 3*x(n-1)-3*x(n-2)+x(n-3)+1+(1-(-1)^(n-1))/2
x(0)=0, x(1)=1, x(2)=5
and x(28)=5985

Yay combinatorics!

Alright, let's see: the Gray Triangles are straightforward. There are (counting) 28 down every side, and as such, there is 1 28-unit regular triangle, 1+2 = 3 27-unit regular triangles, 1+2+3 = 6 regular 26-unit triangles... Following this pattern, we have ∑n(29-n) for 1≤n≤29 integers, which sums to 4060.
Now for the Yellow Triangles. There are 27 down every side, thus there are 27+26+25+24+...+1, or (27*28)/2 1-unit regular triangles. There are 25+24+23+22+...+1, or (25*24)/2 2-unit regular triangles. Following this pattern, we have ∑n(2n-1) for 1≤n≤14 integers, as the largest n-regular yellow triangle is 14x14x14. This sums to 1925.
As there are no irregular triangles to be found, the total is union of the partial sums, 4060+1925=5985. Woo fun!

What is the sum of all the areas of the triangles?

I get 417711 (with a small grey triangle counting as 1).

Grey triangles are simply (!) the tetrahedral numbers so for row n:
: grey triangles = n(n+1)(n+2)/6

Yellow triangles are similar but start a row later & only add a new size in every second row. After failing to adapt the tetrahedral formula I calculated the first the terms manually - 1, 3, 7, 13, 22, 34 which gave me http://oeis.org/A002623. Using the formula under 'Comment from Radu Grigore' we have
: yellow triangles = floor( (n+2)(n+4)(2n+3)/24 )

Excel informs me that when I add these together with n=28 we have 5985 triangles :-)

Of course you can calculate a few rows and jump straight to http://oeis.org/A002717 but that's not nearly as much fun!

42. The Answer is 42.

The way I would do it, which may not be the best way, is to consider a combinatorial approach. Pick a row, then pick an entry. The number of possible choices is easy enough to derive. From there, we can consider choosing a second point in the same row (restricting ourselves to one side). From there, we can argue that there are either 1, 2 or no valid triangles that can be formed. The number can be expressed as a function of the position of the first point, and its difference form the second.

I can't be bothered to work it out, though...

Pffh! It's easy. 28 smallest triangles on a side = n.

Then the formula for total triangles is Sum (i = 1 to n) i^2.

THat is, one triangle on a side gives 1 total
2 triangles on a side = 1 + 4 = 5 total (as given)

. . .

28 triangles on a side = 1 + 4 + 9 + . . . + 784 = Sum

The calculations are left as an exercise for the student.

I make it 7714. But then I can hardly count, much less calculate.

Darn it! I spent a long time finding a formula, but I completely forgot about the large, downward facing triangles :( If you don't count those you get 4438, but that's incorrect. I'll see if I can adjust the formula tomorrow so it includes the downward facing ones. Congratulations to all you other smart people who figured it out :)

is it over 9000? lol :)

1513 = (28 * 28) + (27 * 27)

Sorry forgot to clarify, answer is ALWAYS grey triangle squared plus yellow triangle squared, regardless of size.

I get 5985 from n(n+2)(n+0.5)/4 which is n(n+1)(2n+1)/12 (upward pointing triangles) + m(m+1)(4m-1)/12 (downward pointing triangles) where m = floor(n/2). (Generalized formula works for even n only)

for even: 1/8n(n+2)(2n+1)
for odd: 1/8[n(n+2)(2n+1)-1]

So: 28/8*30*57 = 5985 :)
Under 9000 :(

(where n = number of bottom triangles pointing upward)

There's a recursive function and I don't really know how to handle those. Here's what I've got:
Corner-Upwards triangles: u(n)= x/3 + (x^2)/2 + (x^3)/6
(got that one through interpolation with five points)
Corner-Downwards triangles: d(n)= u(n) - d(n+1)
All triangles: t(n)= u(n)+d(n)

Replace x with n in the first equation of course.

And n is the number of bottom triangles. Should work with both odd and even numbers. But as I said I'm not able to simplify recursive functions. Can someone do that for me?

Got 4440, felt confident, read comments, felt less confident.

I got 7714 after figuring that for the case of three rows, the number of triangles is 3^2+(3-1)^2+(3-2)^2 or seq(i^2,i,1,n,1) where n is the length of row. Solving for 28 rows gives me 7714... anything wrong with what I did?

You might want to re work your case for 3 rows because you are saying there are 9+4+1=14 triangles but I get 9+3+1=13 triangles

Took wayyyy too long, but I also got 5985. Had to work out the Wolfram formula for myself. Happy I did it though!

1513 (28^2 + 27^2)

I count 5985. That's all grey triangles of any size (4060) + the center inverted triangle (560) + three times the possible orange triangles from a corner to the center (1365)

In Wolfram Alpha code: (sum b(29-b), b=1 to 28) + (sum v(15-v), v=1 to 14) + 3 (sum (sum (n+1-m), m=1 to n), n=1 to 13)

I get 7714.
Pick two points on a horizontal line. They form the base of a unique grey triangle. And, except for the bottom row, the base of a unique yellow "upside-down" triangle.
There are n.(n-1)/2 choices of points in each horizontal row.
So the answer is:
29*28/2 (bottom row, grey only)
+ 28*27 (second row, yellow and grey)
+ 27*26 + 26*25 + ... + 2*1
= 7714

What if I were to pick the 4th row from the bottom and the 2nd and 2nd from the end vertices? There's no downward pointing triangle connecting them.

Replace "Pick two points" with "Pick two distinct points".
If you interpreted "Pick two points" as allowing you to pick the same point twice, then you should also have complained that the number of choices should be n.n/2 rather than n.(n-1)/2.

OK, sorry, misinterpreted your comment (ignored the "from the end" bit).
You're right, 7714 is wrong. I've been out of the game too long.

I counted 7714. (28*29*30)/6 "grey oriented" and (27*28*29)/6 "yellow oriented".

Just wondering. Don't all of the answers need a +1 to account for the triangle that contains the triangles?? I would think that an odd number would be expected

I figured it out this way:
Counting row by row, each row adds to little triangles to the previous row, and it start with 1, then 3, 5, 7... the formula for this sum is 1 + 3 + 5 + ...+2n-1 = n² (very easy to prove by induction), there are 28 rows, so it must be 28^2 = 784

People: You're supposed to count ALL the triangles, not only the small ones... (I'm for 5985, btw)

I did the following:
Let's first count the upwards triangles. Starting from the top, I considered horizontal lines. Each grey triangle above the line forms with it one unique triangle. If we number the lines from the one below the top grey triangle, the number of grey triangles above one line "n" is going to be (n^2+n)/2 (by the sum formula of arithmetic progression). Summing everything up, it'll be 4060 upward triangles;

if you reflect the grey triangles in relation to the horizontal lines, you clearly see that you could count the downward ones by the same formula untill the line nº 14; for then on, the easiest way to correct the formula is to subtract the triangles that go over the 28º line. For example: in the line 15, there'll be 15 rows of grey triangles, and the formula considers that there is also 15 rows of yellow triangles; so, we take off the 2 lower rows of yellow triangles, which represent the same amount of triangles of line nº 2. In the line nº16, we will have to take off the amount of triangles we calculated for line nº4, and so on.

The total amount of triangles we had to take of is [(2n)^2+2n]/2 = 2n^2+n for n from 1 to 14. The result is 2135.

So, the final result is 2*4060-2135=5985

Sorry for the bad english, but I can't find any mistake on this sollution. if anyone does, please comment!

For one triangle of N rows, I would say ∑(n^2+n)[from 1 to N] - ∑(2n^2+n)[from 1 to N/2] if N is even. If N is odd ∑(n^2+n)[from 1 to N] - ∑(2n^2-n)[from 1 to (N+1)/2]

Ok so the big triangle consists of 28 horizontal lines and 28 sloped lines in each of the two other directions. Since each possible combination of three non parallel lines defines one unique triangle, there's 28^3 = 21 952 possible triangles.

Actually scratch that, it would only work if the lines extended outside the big triangle.

I fully agree with Americo, and have 5985 as my final answer.

5996 if you count the extra triangles in the picture :P

I may be way off base here, but I'm looking at this through the lens of an iterated function system (like the sierpinski triangle, except including the middle triangles). The are four maps, which means there are 4^n triangles at "level n". Since the total number of triangles is equal to the sum of all the triangles at each level, there should be Sum(4^k,0,n) triangles in total. N should be the number of small triangles of one color along one side.

darn, was counting them but forgot the larger upside down triangles
I wonder how many people are just counting equilateral triangles and skipping other types :p

are there any triangles that are not equilateral ?
I see only 60 degree angles.

The answer is 7714. It is basically sigma(n^2) = n(n+1)(2n+1)/6.

For further validation, put n=2. You get 5. n=3, you get n=14.

I make 5996:
There are 5985 in the large triangle;
There are 5 in the "example" triangle;
There are 6 instances of the capital letter A, all of which contain a triangle ;)

Woohoo. I've spent the past day or so with this problem in the back of my mind, and when looking at what people got, it agrees with my answer of 5985 :D. Coming up with a general purpose equation all by myself by just thinking it through has been very rewarding, thanks for the great puzzle! Also, my equation is f(n) + (u^2 + u)/2 + 2* f(v) + 2 * f(b) where f(x) = 1/6 x^3 + 1/2 x^2 + 1/3 x; u = floor(n/2); v = floor((n-1)/2); b = floor((n-2)/2). The main pride of this being f(x), which is the third degree version of triangle numbers, which I come up with by just thinking about it in bed, then doing a tiny bit of algebra to simplify.

With each row of k grey triangles we add, we're adding k(k+1)/2 upwards-pointing triangles (k of size 1, k-1 of size 2, k-2 of size 3, etc). That's the triangle numbers (https://oeis.org/A000217).
We're also adding downwards-pointing triangles, for which the formula is a little more complex. If k is odd, it's 0, 2+0, 4+2+0, etc. That's (k/2)(k/2+1) (twice the half triangle number).
If k is even, it's a(k-1) + k/2
(always round down).
That's this sequence: https://oeis.org/A002620
So in total, we need to add those two sequences together and receive this: https://oeis.org/A006578
Finally, we'll need to calculate sum(k=1;k<=n;a(k)), and we'll end up here: https://oeis.org/A002717
Now we simply need to pick the 28th number from that sequence, yielding 5985.

Definitely 5985. The number of triangles with respect to rows is:
(1/2)* summation from k=0 to n of ((n+1)-k)(n-k) + (1/2) * summation from k=0 to n/2 of ((n-1)-2k)(n-2k).... kinda brute force method.

Easy. Pick any two collinear points. The third point will be one of two points. However this only works when the line determined by the two points is not an edge of the triangle.

If the two points both lie on an edge of the triangle, then they uniquely determine a third point. Therefore the total number of triangles is

2A + B where

A is the number of ways to choose two points that do not both lie on the outermost triangle

B is the number of ways to choose two points on the outermost edge.

I remember that I developed a formula for this when I was a child. But I don't remember the formula.

1890 ??

total yellow triangles=378

according to question one yellow makes a 5 triangle pair


21574 28*28*28-(1+2+3+...+27)

sorry wrong answer.


= 784 + 833 + 715 + 611 + 520 + 441 + 373 + 315 + 266 + 225 + 191 + 163 + 140 + 121 + 105 + 91 + 78 + 66 + 55 + 45 + 36 + 28 + 21 + 15 + 10 + 6 + 3 + 1



i did

for n0=1
t1 = n0 + (n0+2) + (n1+2)...+ (n27+2) = 784
t2 = n0 + (n0+1) + (n1+1)...+ (n26+1) = 378
t3 = n0 + (n0+1) + (n1+1)...+ (n25+1) = 351
t26 = n0 + (n0+1) + (n1+1) = 6
t27 = n0 + (n0+1) = 3
t28 = n0 = 1
t1+t2+t3+....+t28 = 4438

5 4
13 8 4
27 14 6
48 21 7
78 30 9
118 40 10
170 52 12
235 65 13
315 80 15
411 96 16
525 114 18
658 133 19
812 154 21
986 176 22
1186 200 24
1411 225 25
1663 252 27
1943 280 28
2253 310 30
2594 341 31
2968 374 33
3376 408 34
3820 444 36
4301 481 37
4821 520 39
5381 560 40
5983 602 42

made a silly error, repost:-1
5 4
13 8 4
27 14 6
48 21 7
78 30 9
118 40 10
170 52 12
235 65 13
315 80 15
411 96 16
525 114 18
658 133 19
812 154 21
988 176 22
1188 200 24
1413 225 25
1665 252 27
1945 280 28
2255 310 30
2596 341 31
2970 374 33
3378 408 34
3822 444 36
4303 481 37
4823 520 39
5383 560 40
5985 602 42
First column is number of triangles, second row is how many triangles were created by adding an extra row. third row shows how many more triangles are added this row than were on the previous row.

How about the general formula for the number of triangles, this one seems to work:

That is, where n is length of the triangle side

I just made a general formula for any size triangle:

yellow color is 28 and grey one is 27...so cout 28+27+28...+1 and same with grey as 27+26+25....1 = 784. then 4 triangle is equal to 1 also..then 784/4=196. so ans is 784+196=980.

Let n = the number of small triangles on the large triangle's base leg. Then, T(n) is the total number of all upward-facing plus downward-facing smaller triangles contained in the large triangle.
T(n) = floor(n * (n + 2) * (2n + 1) / 8)
T(28) = floor((28*30)*(56+1))/8
T(28) = floor((840)*57)/8
T(28) = floor(47880/8) = 5985

I forgot to add that using the Floor function eliminates the remainder you get when the number of base triangles is an odd number.

Leave a comment

Profile pictures are tied to your email address and can be set up at Gravatar. Click here for recent comments.
(Note: You must have javascript enabled to leave comments, otherwise you will get a comment submission error.)
If you make a mistake or the comment doesn't show up properly, email me and I'll gladly fix it :-).


home     info     archive     contact     rss

Google+ Page   //   Facebook Page   //   Twitter Page

Welcome to Spiked Math!

Hello my fellow math geeks. My name is Mike and I am the creator of Spiked Math Comics, a math comic dedicated to humor, educate and entertain the geek in you. Beware though, there might be some math involved :D

New to Spiked Math?
View the top comics.

New Feature: Browse the archives in quick view! Choose from a black, white or grey background.