I'm working on a pattern in the form below: $$ 1 1 1 1 1 1$$ $$ 1 2 2 2 2 2$$ $$ 1 2 3 3 3 3$$ $$ 1 2 3 4 4 4$$ $$ 1 2 3 4 5 5$$ $$ 1 2 3 4 5 6$$ If i took the diagonals $123321$ an upper and lower triangle formed. Whenever i subtract the sum of all elements in the lower triangle to the sum of all elements in the upper triangle, in every possible size of this array I always come up with a sum of triangular number. But I cant prove how this happened... I already work out in proving the other diagonal to be consecutive natural number and as well as the diagonals always form palindromic numbers... but im wondering how will i prove my problem about triangular number. I make used of minimum (i,j) as starting point. But I go to nowhere... any idea?
2 Answers
Let me see if I understand correctly.
You have an array like the following: \begin{matrix} 1 & 1 & 1 & 1 & 1 & 1\\ 1 & 2 & 2 & 2 & 2 & 2\\ 1 & 2 & 3 & 3 & 3 & 3\\ 1 & 2 & 3 & 4 & 4 & 4\\ 1 & 2 & 3 & 4& 5 & 5 \\ 1 & 2 & 3 & 4 & 5 & 6 \end{matrix}
Now you split it into an upper triangle and lower triangle: \begin{matrix} 1 & 1 & 1 & 1 & 1 & &&&& &&&& &\\ 1 & 2 & 2 & 2 & & &&&& &&&& &2\\ 1 & 2 & 3 & & & && \& && &&&&3& 3\\ 1 & 2 & & & & &&&& & & & 4& 4 & 4 \\ 1 & & & & & &&&& & &3&4 & 5 & 5\\ & & & & & &&&& & 2 &3 &4 & 5 & 6 \end{matrix} Now add all the elements in the lower triangle and call this $L$, add all the elements in the upper triangle and call this $U$. The difference $L-U$ can be computed by subtracting corresponding elements one at a time. What I mean is, first reflect the lower triangle like so: \begin{matrix} 1 & 1 & 1 & 1 & 1 & &&&& 6&5&4&3&2 &\\ 1 & 2 & 2 & 2 & & &&&& 5&5&4&3& & \\ 1 & 2 & 3 & & & && \& && 4 &4&4 && & \\ 1 & 2 & & & & &&&& 3& 3& & & & \\ 1 & & & & & &&&& 2& & & & & \\ & & & & & &&&& & & & & & \end{matrix}
This transformation is done by sending the $i$th row to the $7-i$th row, and the $j$th column to the $7-j$th column, so the entries in the triangle on the right are given by $\min(7-i,7-j)$. In general it will be $\min(n+1-i,n+1-j)$ if you start with an $n \times n$ grid. Now subtract element-by-element:
\begin{matrix} 6-1 & 5-1 & 4-1 & 3-1 & 2-1 & &&&& 5&4&3&2&1 &\\ 5-1 & 5-2 & 4-2 & 3-2 & & &&&& 4&3&2&1& & \\ 4-1 & 4-2 & 4-3 & & & && = && 3 &2&1 && & \\ 3-1 & 3-2 & & & & &&&& 2& 1& & & & \\ 2-1 & & & & & &&&& 1& & & & & \\ & & & & & &&&& & & & & & \end{matrix}
We can clearly see in the example that the sum of these elements will be a sum of triangular numbers, but we haven't proven it in general. Let's prove that the $k$th north-east diagonal contains the number $n-k$ (so in the example above, the first diagonal contains the number $5$, the second the number $4$, and so on). The $k$th diagonal consists of entries with coordinates $(i,j)$ such that $i+j=k+1$. If $i \leq j$, then $n+1-i \geq n+1-j$, so we have $$\min(n+1-i,n+1-j)-\min(i,j) = n+1-j-i = (n+1)-(i+j)= (n+1)-(k+1)=n-k.$$ Similarly, if $j \leq i$, then $n+1-j \geq n+1-i$, so $$\min(n+1-i,n+1-k)-\min(i,j)=n+1-i-j=(n+1)-(i+j)=(n+1)-(k+1)=n-k.$$
So, the $k$th north-east diagonal contains the number $n-k$, and it contains $k$ copies of it. So the sum of all the elements is: $$\sum_{k=1}^{n-1}(n-k)k=\sum_{k=1}^{n-1}k\sum_{i=1}^{n-k}1=\sum_{k=1}^{n-1}\sum_{i=1}^{n-k} k =\sum_{i=1}^{n-1}\sum_{k=1}^{n-i}k.$$ Now $\sum_{k=1}^{n-i}k$ is the $n-i$th triangular number, and we are summing these from $i=1$ to $i=n-1$. In other words, we get the sum of the first $n-1$ triangular numbers.

- 20,808
- 1
- 22
- 41
-
Im referring to other diagonal sir...from lower left most 1 to the upper rightmost 1... that is 123321... – rosa Jan 26 '19 at 14:36
-
1I see the diagonal now. But can you clarify by what you mean by "subtract the lower triangle to the upper triangle"? Do either triangles contain the diagonal, or are you only looking above and below it? Also, I am not a sir. – kccu Jan 26 '19 at 14:37
-
What I mean by "subtracting the lower triangle to the upper triangle" im referring to the sum of all elements in the lower triangle and sum of all elements in the upper triangle, that is, (2+3+4+5+6+3+4+5+5+4+4+4+3+3+2)-(1+1+1+1+1+1+2+2+2+1+2+3+1+2+1) = 57 - 22 =35 – rosa Jan 26 '19 at 14:56
-
But $35$ isn't a triangular number. – kccu Jan 26 '19 at 14:58
-
Aw.. i know my mistake.. it must not be triangular number but a sum of triangular number...my bad maam... 35 is a sum of triangular number 1 +3+ 6+ 10+ 15 = 35 – rosa Jan 26 '19 at 15:10
-
Updated with proof. – kccu Jan 26 '19 at 15:53
The element at location $(r,c)$ indeed has the value $\min(r,c)$.
The main diagonal is $(r,r)$, hence values $\min(r,r)=r$, linear.
The other diagonal, $(r,n+1-r)$, giving $\min(r,n+1-r)$, triangular.
-
Can't tell you more until you explain "subtract the lower triangle to upper triangle". – Jan 26 '19 at 14:56
-
Sum of the elements on the upper triangle to be subtracted from the sum of all elements in the lower triangle... – rosa Jan 26 '19 at 15:18
-
-
-
-
I simply observe the pattern... but i cannot formulate how do you come with the formula of the other diagonal... – rosa Feb 16 '19 at 01:49
-
I read this article but I can not still understand how u come up with ur formula https://math.stackexchange.com/questions/46939/modus-operandi-formulae-for-maximum-and-minimum-of-two-numbers-with-a-b-and – rosa Feb 16 '19 at 06:40