Sunday, November 6, 2011
How do I determine the first number in an Nth row of a triangular pattern?
So, after the 1st row is constructed, there is 1 number in the triangle. After the 2nd row is constructed, there are 1 + 3, or 4, numbers in the triangle. After the 3rd row, there are 1 + 3 + 5, or 9, numbers in the triangle. So, for the nth row, there will be 1 + 3 + 5 + ... + (2n - 1) + (2n + 1) numbers in the triangle, which is equal to n^2. So, we know the last number of any row is equal to the amount of numbers in the triangle, which is n^2. So to get the first number in a row, we need to get the last number of the row before it, (n-1)^2, and add 1. So, the first number of the nth row is (n-1)^2 + 1.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment