The Christmas Triangle Tree

93 Views Asked by At

The Triangles Christmas Tree.

This problem consists in finding an expression that gives the total number of triangles of a Triangles Christmas Tree (see picture: https://drive.google.com/file/d/1jR247VmBn437U4hAh3sl-oy2n-u24vK-/view?usp=sharing) of $n$ levels. For the notation the lower index is the size of the triangle, and the upper triangle is the level on the tree from the top. I have divided the problem in 2 parts: Straight and inverted triangles.

Straight Triangles

Number of straight triangles of size $1$ of each level for levels $1\;...\;n$

$N\Delta_1^1=1,\;N\Delta_1^2=2\;...\; N\Delta_1^n=n$

Number of straight triangles of size $2$ of each level for levels $1\;...\;n$

$N\Delta_2^1=0,\;N\Delta_2^2=1\;...\; N\Delta_2^n=n-1$

...

Number of straight triangles of size $i$ ($i\leqslant n$) of each level for levels $1\;...\;n$. The first triangle of size $i$ starts at level $i$.

$N\Delta_i^1=0\;...\;N\Delta_i^i=1\;...\; N\Delta_i^n=n-i+1$

Number of total straight triangles of size $1$ for a tree of size $n$

$$N\Delta_1=\sum_{j=1}^n \Delta_1^j = \frac{n}{2}(n+1)$$

Number of total straight triangles of size $2$ for a tree of size $n$

$$N\Delta_2=\sum_{j=2}^n \Delta_2^j = \frac{n-1}{2}(n)$$

...

Number of total straight triangles of size $i$ for a tree of size $n$

$$N\Delta_n=\sum_{j=i}^n \Delta_i^j = \frac{n-i+1}{2}(n-i+2)$$

Total number of straight triangles of a tree of size $n$

$$N\Delta=\sum_{i=1}^n \sum_{j=i}^n \Delta_i^j = \sum_{i=1}^n \frac{n-i+1}{2}(n-i+2)$$

$$N\Delta=\frac{(n+1)(n+2)}{2}\sum_{i=1}^n 1+\frac{1}{2}\sum_{i=1}^n i^2-\frac{2n+3}{2}\sum_{i=1}^n i$$

$$N\Delta=\frac{n(n+1)}{2}(n+2)+\frac{1}{2}\frac{n(n+1)(2n+1)}{6}-\frac{2n+3}{2} \frac{n(n+1)}{2} $$

$$N\Delta=\frac{n(n+1)}{2}\Biggl[(n+2)+\frac{(2n+1)}{6}-\frac{2n+3}{2}\Biggr] $$

$$\bbox[10px,border:1px solid red]{N\Delta=\frac{n(n+1)(n+2)}{6}} $$

Inverted Triangles

Number of inverted triangles of size $1$ of each level for levels $1\;...\;n$

$N\nabla_1^1=0,\;N\nabla_1^2=1\;...\; N\nabla_1^n=n-1$

Number of inverted triangles of size $2$ of each level for levels $1\;...\;n$

$N\nabla_2^1=0,\;N\nabla_2^2=0,\;N\nabla_2^3=0,\;N\nabla_2^4=1\;...\; N\nabla_2^n=n-3$

...

Number of inverted triangles of size $i$ ($i\leqslant n$) of each level for levels $1\;...\;n$. The first triangle of size $i$ starts at level $2i$.

$N\nabla_i^1=0\;... N\nabla_i^{2i}=1\; ...\; N\nabla_i^n=n-2i+1$

Number of total inverted triangles of size $1$ for a tree of size $n$

$$N\nabla_1=\sum_{j=2}^n \nabla_1^j = \frac{n-1}{2}(n)$$

Number of total inverted triangles of size $2$ for a tree of size $n$

$$N\nabla_2=\sum_{j=4}^n \nabla_2^j = \frac{n-3}{2}(n-2)$$

...

Number of total inverted triangles of size $i$ for a tree of size $n$

$$N\nabla_i=\sum_{j=2i}^n \nabla_i^j = \frac{n-2i+1}{2}(n-2i+2)$$

Total number of inverted triangles for a tree of size $n$

$$N\nabla=\sum_{i=1}^{\lfloor{n/2}\rfloor} \sum_{j=2i}^n \nabla_i^j = \sum_{i=1}^{\lfloor{n/2}\rfloor} \frac{n-2i+1}{2}(n-2i+2)$$

$$N\nabla=\frac{(n+1)(n+2)}{2}\sum_{i=1}^{\lfloor{n/2}\rfloor}1+\frac{1}{2}\sum_{i=1}^{\lfloor{n/2}\rfloor}4i^2-\frac{1}{2}\sum_{i=1}^{\lfloor{n/2}\rfloor}2i(2n+3)$$

$$N\nabla=\frac{(n+1)(n+2)}{2}\lfloor{n/2}\rfloor+2\sum_{i=1}^{\lfloor{n/2}\rfloor}i^2-(2n+3)\sum_{i=1}^{\lfloor{n/2}\rfloor}i$$

$$N\nabla=\frac{(n+1)(n+2)}{2}\lfloor{n/2}\rfloor+\frac{\lfloor{n/2}\rfloor(\lfloor{n/2}\rfloor+1)(2\lfloor{n/2}\rfloor+1)}{3}-(2n+3)\frac{\lfloor{n/2}\rfloor}{2}(\lfloor{n/2}\rfloor+1)$$

$$\bbox[10px,border:1px solid red]{N\nabla=\frac{(n+1)(n+2)}{2}\lfloor{n/2}\rfloor+\frac{\lfloor{n/2}\rfloor(\lfloor{n/2}\rfloor+1)(4\lfloor{n/2}\rfloor-6n-7)}{6}}$$

Is there any way to find an expression of the inverted triangles without the $\lfloor{n/2}\rfloor$ ?