How many triangles in a triangle of side four?
An equilateral triangle of side 4 is divided by lines parallel to its sides into 16 small equilateral triangles of side 1 (rows of 1, 3, 5 and 7 small triangles).
How many triangles of all sizes can be found in the figure? Count the upward-pointing and downward-pointing triangles separately, and give the totals for a triangle of side 3 as a check.
Show a hint
Upward triangles of side k have their top corner at any of the grid points in the top n minus k + 1 rows. Downward triangles of side k need room below them, so they fit only in the lower rows and only up to side n/2.
Your answer
Solving needs a free account
Answers, streaks and solutions unlock when you are signed in. Reading the question and the hint stays free.
Discussion
💡 Discussion rules
- No full solutions here. Hints and approaches only.
- Complexity, edge cases and intuition are the point.
- Interview experiences are welcome. Respect your NDAs.
Loading discussion…
Learn the concepts
The theory behind this question.