So I finished this post on July 7th for the 4th of July, I figure I honor America with more math. Seems after I wrote the post I did what I always tend to do, I made a mistake. I owe "howsiwei" for the push in the right direction, I like to give credit where it is due. The funny thing about this mistake is that I made the same error twice on this problem. The first time I encountered this problem was with my math teacher, I was taking advanced mathematics. That title is just a fancy way of saying I am taking a proof class, basically numbers go out the window and letters rule the world.

I used to joke that about mathematicians using every letter in the English alphabet, turns out I was wrong. They used up the Greek alphabet and even went to Hebrew letters. How messed up is this field of study that you span more than two alphabets? You probably heard me say this before, I still believe it to be true.

Well anyway, back to the problem. My teacher and I came across this old Polya problem. Its in Mathematics and Plausible Reasoning, Volume 1: Induction and Analogy in Mathematics book, the next problem in line for me.

The problem given states this:

The tree sides of a triangle are of lengths 'l', 'm', and 'n', respectively. The numbers 'l', 'm', and 'n' are positive integers.

Find the number of different triangles of the described kind for a given 'n'. [ Take n = 1, 2, 3, 4, 5, ..., n] Find a general law governing the dependence of the number of triangles on 'n'.

Before we even start at the basic level of problem solving you should remember one fundamental rule about triangles. This is what me and my professor made the mistake in, only one person out of the whole class remembered this rule. Which was a shame because we spent practically the whole class doing the problem wrong, even worse is I did the exact same thing on this post. Oh well, another fail on my belt.

First lets look at the what the triangle inequality is, if we look at proofwiki. If this is not evidence enough than try looking here. If we wish to see the reverse, here is an explanation of the converse. I am not going to dwell on the proof of the triangle inequality because that is not what this particular post is about.

So whats this problem really asking us? To me its saying here is a system of some sort, find its pattern. Well that put me in high spirits, cause finding pattern is what I love to do. I also made note that the problem stated that we would be working with positive integers only, so 0 is out of the question.

I generally like to work out a problem first and then write up a post, but I had tried doing this problem on "fly". This method does not lead me to correct results right way, but the amount of insight I gained was tremendous. The proof is in the comments, I spent the last 8 months thinking of a way to explain this problem with a new perspective.

The way I solve math problems is to just stick my head in and go for it, I can't just sit there and remember axioms and formulas all day (clearly now). I literally start from the ground up, eventually I can speed things along. So lets start:

- [
**Step 1**:] Let n = 1, its a safe bet. Besides we can't really start from anywhere lower, and picking larger integers for 'n' does not seem fruitful. So if 'n' is 1, then by the given problem 'l' and 'm' also must be equal to 1. 'l' an 'm' can not go any lower, so they have to be equal in this case. All three sides are equal and set to 1, so we have an equilateral triangle. The triangle equality holds true here, so we are still good.

, , and

- [
**Step 2**:] Step 1 worked out well for us, we did not run into any real complications. Now lets let 'n' be equal to 2:

, , and

- We get another equilateral triangle, I going to throw out a conjecture and say no matter what value we give 'n' there will be at most one equilateral triangle. We can not change the values of 'n', but we can change the values of 'l' and 'm'. So lets change the value of 'm' by 1 and work our way down from there.

, , and

- As you can see, there is a mistake here. I can not change the value of 'm' and expect the value of 'l' to stay the same. In the above case, the variable 'l' is larger than the the variable 'm'. This violates the given parameter that

- The variable 'l' will also change as we change the variable 'm'. Its like a cascade effect. But the larger the variable 'm' is, the more the variable 'l' can take on different values. This is true for the variable 'm' with respect to 'n'. So the right way to denote the change in variables 'l' and 'm' is to decrease the variable 'l' by 1 first:

, , and

- Now that we have gotten the variable 'l' to its lowest integer, we can decrease the variable 'm' by 1 then repeat the process for the variable 'l'. We keep up this repeating process of decreasing the variable 'l' down to 1, then decreasing the variable 'm' by 1 until it reaches its lowest integer. This is
**very important**concept to understand, I made the mistake as I worked this out and had to go back. Moving on we decrease the values :

, , and

- I can not go any lower for the variable 'l' and 'm', and 'n' has to stay the same cause its whats given to us. So we ended up with only three different sets of triangles, I can already get a gut feeling that this pattern will not be so straight forward.

- [
**Step 3**:] Let n = 3, this is the game changer for us. Its the first different odd integer we encounter. This will tell us a lot about how the pattern may form from here onward. We start with all three variable being equal:

, , and

- We ended up with our equilateral triangle, not so much news worthy. Lets decrease the variables 'l' by 1 until we reach the lowest integer:

, , and

- As we can see, the variable 'l' has not reached the lowest integer yet. So we must keep decreasing it by 1 before we can change the variable 'm':

, , and

- The variable 'l' has reached the lowest integer, so now we can change the variable 'm' by reducing it by 1. Remember every time you decrease the variable 'm', you reset the variable 'l' to equal 'm':

, , and

- The variable 'l' has not reached the lowest integer again, decrease it by 1:

, , and

- We have reached the lowest integer for the variable 'l' again, now we may decrease the variable 'm' by 1. Remember to set the variable 'l' to equal the variable 'm':

, , and

- I can not go any lower for the variable 'l' and 'm', so now I count how many different triangles I have made. We made 6 different triangles when n is 3, this twice as much when n was equal to 2. There is still to little data to know the full pattern yet, I like to repeat a process at least 5 times before I make any conjectures. I will write out the different combinations with out the step by step detail, you will be able to see the pattern a little easier this way.

- [
**Step 4**:] Let n = 4:

- We can see some what of a pattern here, notice how the values for the variable 'm' take the same value exactly the number of times as its number. The variable 'm' has the value of 4 fours times, the value of 3 three times, the value of 2 two times, and the value of 1 one time. If we add all the different values for the variable 'm' we obtain the number of different triangles.

- So all together we had 10 different triangles when we set 'n' equal 4.

- [
**Step 5**:] Let n = 5:

- If we count up the different combinations, we end up with 15 different triangles. Looking back at all the other values of n, I start to recognize a sequence of numbers. To confirm my suspicion I will work out the next two values of 'n', which would be 6 and 7. Then I will make a list of all values of n and see if there is any recognizable pattern.

- [
**Step 6**:] Let n = 6, read down the column before you read the next column in the following table:

- If we count only the combinations with numbers in them, then there is 21 different combinations of triangles when 'n' is 6.

- [
**Step 7**:] Let n = 7, read down the column before you read down the next column in the following table:

- If we count only the combinations with numbers in them, then there is 28 different combinations of triangles when 'n' is 7.

- [
**Step 8**:] Now, let us look at a table I made for this problem. I like making tables to be able to see any recognizable pattern.

- Looking at the table we can see how the number of correct triangles for the previous
*n*is also the incorrect amount of triangles for the*n+1.* - Also, notice how the percentage for correct/incorrect triangles is the same for every two
*n.*When n is 1 and 2 the percentages are the same respectively. When n is 3 and 4 the percentages for correct/incorrect triangles are the same respectively.

- Pay attention to the number of triangles for each value that 'n' takes on, we have a special sequence of numbers.

- If you actually own the Mathematics and Plausible Reasoning, Volume 1, and provided you have read the first chapter and worked out the first 4 problems, then these set of numbers will mean something to you. If you did not do any of this then you may look at my previous work to understand what I am talking about. These numbers signify the triangle numbers, take the difference between each element of the above sequence and you will get back the natural counting numbers.

- If we look at the formula for triangle numbers:

- [
**Step**9:] We must check to see if our formula for triangle numbers works for this given problem. We will iterate through 1-7 for 'n' and check to see if we indeed get the same numbers:

- As we can see, our sequence of results is indeed 1,3,6,10,15,21,28. The same sequence we see in the table I made. Interesting enough, if you look at Pascal's Triangle you can see the same sequence of numbers as one of the diagonals.

- [
**Step 10**]: Now lets look at a few formulas that might be useful here, assume that n > 0. - The formula for any even integer:

- The formula for any odd integer:

- The formula for the sum of the first odd integers:

- The formula for the sum of the first even integers:

- This is the one step that has had me confused for 8 whole months! Why on God's green earth I could not see the difference so simply was at the time beyond me. When looking for a pattern, it is very important you don't fall prey to the details. You can be engulfed so much by the pattern, that all you see is what you want to see. Nothing else seems to pierce your eyes other than the pattern you think you see, the only solution that I know of for this is okham's razor.

- It just so happens that by mere chance a coworker of mine happen to take a look at my problem. I owe this solution to a miss Pamela Nation, with out her it might have taken even longer to find. She saw that I was trying to add the equations of summation for even and odd numbers. So she simply asked, why are you adding these two equations? Then she looked at my paper with the table on it and realized what I was trying to do. Then she simply pointed out that I was using same variable for two different references.

- We have the variable 'n' for which I use as the index for the number of triangles. Then there is also the variable 'n' which is seen in the formula for the summation of odd and even integers. Well when you mix the two of them...you get a headache.

- So the solution is simply this: We will use the letters 'i' and 'n' as our variables.

- [
**Step 11**]: Now using our two variables we can derive a formula. Looking at the table I made earlier, notice for every two consecutive 'n's there is a square. Let me show you what I am mean. When we set :

- We only get one combination, and this one combination is indeed a triangle that does not break the triangle inequality. Now lets look at n + 1:

- If we look at the total number of combinations that we can make when n = 2, there is exactly 3 different combinations. Of the 3, only
*1*combination is incorrect.

- So you can see

- shows up in both indexes. The number of correct triangles is the number of incorrect triangles for the proceeding 'n + 1'. Furthermore, every consecutive squared number takes up exactly two index numbers. This can be seen for every proceeding square on table up until n = 20. There is no proof that every the pattern continues, but there is also no proof that it ends either.

- To further show my point, look at

- When we set n = 3, there is 6 different combinations of triangles that is produced. Take a look at
**Step 3**and count how many different combinations I wrote in the process. Out of the 6 different combinations, there is only*4*that follow the triangle inequality.

- When we set n = 4, there is 10 different combinations. Look at
**Step 4**, you can see the pattern more clearly. The first 6 patterns are correct, the last*4*patterns on the bottom are incorrect.

- The same will be true for for the index numbers of 5 & 6, only we will use 3 squared.

- Looking at

- We set n = 5, there are 15 total combinations. Of these 15 combinations,
*9*are correct and 6 are incorrect. Look at**Step 5**for visual proof.

- When we set n = 6, there is a total of 21 combinations. Of these 21 combinations, 12 are correct and
*9*are incorrect. Look at**Step 6**for visual proof.

- This is the pattern that I was trying to formulate into an actual formula, but I got stuck on the notation. The next step will lead us to the answer.

- [
**Step 12**]: First we recap what is given to us, here are the tools we can work with:

- Lets start with the sum of the odd numbers, because the index starts at 1. Let: the variable 'n' to equal the formula of an odd number.

Solving for 't', we get:

- Now we take the equation for the sum of the first odd integers and we substitute what we just solved for 't'.

- We do the same technique for the sum of the even integers, we set 'n' equal to formula for even integers:

solving for 't', we get:

- Now we take the equation for the sum of the first even integers and we substitute what we just solved for 't'. (I was not kidding when I said it is the same technique)

- Find the LCD, so we can add:

- Now this part is tricky, factor out the 1/4. I do this so you can see the trick, otherwise this gets really complicated.

- From here we need to complete the square for
*n^2 + 2n*: Let b = 2

- So now we can add 1 and subtract 1, that way we are just adding 0 to the expression. Hence, we did not change the problem and no illegal action was made.

- Now we can factor the part of the expression because we just completed the square. I use the associative property to show you what I am factoring in this next step.

- Now factor back the in the 1/4, and this will look like the solution in the book

- That is the exact answer that is in the back of the book, we just reversed engineered the solution. Hope this makes more sense than it did 8 months ago.

References:

- Polya, George.
*Mathematics And Plausible Reasoning: Induction And Analogy In Mathematics*. 6th ed. Vol. 1. Princeton, New Jersey: Princeton University Press, 1954. 1-9. 2 vols. Print. *Wikipedia, the free encyclopedia*. N.p., n.d. Web. 7 June 2013. <http://en.wikipedia.org>. Path: http://en.wikipedia.org/wiki/Triangular_number.*Wikipedia, the free encyclopedia*. N.p., n.d. Web. 7 June 2013. <http://en.wikipedia.org>. Path: http://en.wikipedia.org/wiki/Completing_the_square.- "Pascal's Triangle And Its Patterns."
*Pascal's Triangle And Its Patterns*. N.p., n.d. Web. 7 July 2013. <http://britton.disted.camosun.bc.ca/>. Path: http://britton.disted.camosun.bc.ca/pascal/pascal.html. *Wikipedia, the free encyclopedia*. N.p., n.d. Web. 7 June 2013. <http://en.wikipedia.org>. Path: http://en.wikipedia.org/wiki/Associative_property.- "Triangle Inequality Theorem Converse."
*Math Open Reference*. N.p., n.d. Web. 7 June 2013. <http://www.mathopenref.com>. Path: http://www.mathopenref.com/triangleinequalityconverse.html. *Wikipedia, the free encyclopedia*. N.p., n.d. Web. 7 June 2013. <http://en.wikipedia.org>. Path: http://www.proofwiki.org/wiki/Sum_of_Two_Sides_of_Triangle_Greater_than_Third_Side.*Wikipedia, the free encyclopedia*. N.p., n.d. Web. 7 June 2013. <http://en.wikipedia.org>. Path: http://www.proofwiki.org/wiki/Triangle_Inequality.- "Triangle Inequality Theorem."
*Math Open Reference*. N.p., n.d. Web. 7 June 2013. <http://www.mathopenref.com>. Path: http://www.mathopenref.com/triangleinequality.html. *Wikipedia, the free encyclopedia*. N.p., n.d. Web. 7 June 2013. <http://en.wikipedia.org>. Path: https://en.wikipedia.org/wiki/Equilateral_triangle.