edge we have
n
. First count the triangles that point up. This is easy to do if you count them by top vertex. Each vertex in the picture is the top of one triangle for every horizontal grid line below it. Thus, the topmost vertex, which has
n
horizontal gridlines below it, is the top vertex of
n
triangles; each of the two vertices in the next row down is the top vertex of −1
n
−
1
triangles; and so on. This gives us a total of
∑=1(+1−)=12(+1)2−∑=12=12(+1)2−16(+1)(2+1)=16(+1)(3(+1)−(2+1))=16(+1)(+2)=(+23)
∑
k
=
1
n
k(n+1−k) =
1
2
n(n+1
)
2
−
∑
k
=
1
n
k
2
=
1
2
n(n+1
)
2
−
1
6
n(n+1)(2n+1) =
1
6
n(n+1)
(
3(n+1)−(2n+1)
)
=
1
6
n(n+1)(n+2) =
(
n
+
2
3
)
upward-pointing triangles.
The downward-pointing triangles can be counted by their by their bottom vertices, but it’s a bit messier. First, each vertex not on the left or right edge of the figure is the bottom vertex of a triangle of height 1
1
, and there are
∑=1−1=(2)
∑
k
=
1
n
−
1
=
(
n
2
)
of them. Each vertex that is not on the left or right edge or on the slant grid lines adjacent to those edges is the bottom vertex of a triangle of height 2
2
, and there are
∑=1−3=(−22)
∑
k
=
1
n
−
3
k
=
(
n
−
2
2
)
of them. In general each vertex that is not on the left or right edge or on one of the ℎ−1
h
−
1
slant grid lines nearest each of those edges is the bottom vertex of a triangle of height ℎ
h
, and there are
∑=1+1−2ℎ=(