yaworsw/euler-manager

View on GitHub
data/problems/163.yml

Summary

Maintainability
Test Coverage
---
:id: 163
:name: Cross-hatched triangles
:url: https://projecteuler.net/problem=163
:content: "Consider an equilateral triangle in which straight lines are drawn from
  each vertex to the middle of the opposite side, such as in the _size 1_ triangle
  in the sketch below.\n\n ![]({{ images_dir }}/p163.gif)\n\nSixteen triangles of
  either different shape or size or orientation or location can now be observed in
  that triangle. Using _size 1_ triangles as building blocks, larger triangles can
  be formed, such as the _size 2_ triangle in the above sketch. One-hundred and four
  triangles of either different shape or size or orientation or location can now be
  observed in that _size 2_ triangle.\n\nIt can be observed that the _size 2_ triangle
  contains 4 _size 1_ triangle building blocks. A _size 3_ triangle would contain
  9 _size 1_ triangle building blocks and a _size n_ triangle would thus contain _n<sup>2</sup>
  size 1_ triangle building blocks.\n\nIf we denote T(<var>n</var>) as the number
  of triangles present in a triangle of _size <var>n</var>_, then\n\nT(1) = 16  \nT(2)
  = 104\n\nFind T(36).\n\n"