Associated Topics || Dr. Math Home || Search Dr. Math

### Counting School Supplies for the First Days of School

```
Date: 07/23/97 at 15:53:19
From: Anonymous
Subject: Triangle number question

Dear Dr. Math,

I am a sixth grade middle school teacher teaching math as a lone
subject for the first time. I found a terrific activity for the
start of the school year, but I don't understand the "rule" entirely.

The problem is counting school supplies for the first twelve days of
school - like the 12 days of Christmas.

I am not sure of triangle numbers but the rule is n(n+1)/2 for each
day and n(n+1)(n+2)/6 for the entire sequence.  I know it works
because I did the math. My question is, where did the divide
by 2 and 6 come from? I know one of my students will ask why you
divide by 2 and 6 and I can't figure it out.

Any help you could give me in understanding this would be greatly
appreciated.

Wendy Bender
```

```
Date: 07/24/97 at 13:53:01
From: Doctor Rob
Subject: Re: Triangle number question

We are pleased that you want to give correct reasons to your students.

Consider this picture (I'll only draw it for n = 5, but you can do
this for any size):

___ ___ ___ ___ ___ ___
6 |   |   |   |   |   | X |
|___|___|___|___|___|___|
5 |   |   |   |   | X |   |
|___|___|___|___|___|___|
4 |   |   |   | X |   |   |
|___|___|___|___|___|___|
3 |   |   | X |   |   |   |
|___|___|___|___|___|___|
2 |   | X |   |   | Y |   |
|___|___|___|___|___|___|
1 | X |   |   |   |   |   |
|___|___|___|___|___|___|
1   2   3   4   5   6

Every box in this diagram is specified by a pair of integers (a, b),
where each is at least 1 and at most 6.  The ones marked with X are
represented by the pairs (a, a).  For example, the box marked with Y
is (5, 2), since it is in the fifth column and second row.

The boxes with a > b are the ones below the diagonal marked with Xs.
They are arranged in a triangle, and their number is the 5th
triangular number, 5*(5+1)/2 = 15. There are (n+1)^2 boxes in all.
We throw away the n+1 boxes marked with Xs, leaving n^2 + n = n*(n+1).
They correspond to all pairs (a, b) with a unequal b. Half of these
are above the diagonal (have a < b) and half are below the diagonal
(a > b).

To count only one of the two triangles, we divided by 2 = 2*1. This
corresponds to the two different pairs you can make out of two unequal
numbers, (a, b) and (b, a), of which you are picking only one. The
result is n*(n+1)/2, as you know.

For pyramidal numbers (sums of triangular numbers), a similar thing
happens, but now we have a three-dimensional cube of boxes, each
specified by a triple (a, b, c), telling you in which column, row, and
plane it lies. Since there are six ways to rearrange three unequal
numbers, and you only want to look at the one of those with a > b > c
which lie in the pyramid, you have to divide by 6 = 3*2*1.

You start with (n+2)^3 numbers and throw out all boxes with a = b or
a = c or b = c or a = b = c. There are (n+2)^2 triples with a = b, and
the same number with a = c, and likewise for b = c, so we subtract
3*(n+2)^2 from (n+2)^3. We have subtracted too much, however, since
we have deducted the (n+2) triples with a = b = c three times. As a
result, we have have to add 2*(n+2) back in to get the correct answer.
This gives (n+2)^3 - 3*(n+2)^2 + 2*(n+2), which, when simplified,
yields n*(n+1)*(n+2). That is the number of triples of unequal numbers
from 1 to n+2.  We have to divide that by 6 to get the number of
triples with a > b > c, as noted above.

There are 5 other copies of the pyramid in the cube, too.  They
satisfy a > c > b, b > a > c, b > c > a, c > a > b, and c > b > a,
respectively.  This may be hard to draw on the blackboard!
Nevertheless, they are there.

Good luck!  I hope this helps.  If not, write back and we'll try again
to explain.

-Doctor Rob,  The Math Forum
Check out our web site!  http://mathforum.org/dr.math/
```
Associated Topics:
High School Sequences, Series