Stellar Numbers

Geometric shapes form polygons with p number of vertices. Considering each vertices as a point, and counting these points, sequences of special numbers are formed. For example, if we have a polygon with three vertices (a triangle) we have a diagram that looks like this:

From this diagram the first set has 1 point, the second has 3, the third has 6, the fourth has 10, and the fifth set has 15 points. We can tell that each set is adding another row to the previous set.

We can use this pattern to find the next three terms in this sequence.

The fifth pattern has 15 points so if we observe the bottom row that has 5 points, we add (5+1) to 15 and get 21. The bottom row of the sixth sequence has 6 points so we can add (6+1) to 21 and get 28. Add (7+1) to 28 and get 35.

To do this with any integer we take the bottom row which is also the set that we are on and add 1 to that number and add the solution of that to our previous set.

For example, take the first pattern that is represented by T1 and add 1 to that number. We now have 2 points. Add those two points to the first sequence and we have wer second sequence. Which is T2 = 1 + 2 = 3.

The pattern continues infinitely, but we can simplify it by coming up with a formula.

We are given:

T1 = 1 = 1

T2 = 1 + 2 = 3

T3 = 1 + 2 + 3 = 6

T4 = 1 + 2 + 3 + 4 = 10

T5 = 1 + 2 + 3 + 4 + 5 = 15

We need to find the sum of T for any natural number given. To do that we can set up a formula that looks like this:

Tn = 1 + 2 + 3 + ... + (n-1) + n =?

Since the number of the next pattern is simply the number of points in the previous pattern plus the nth pattern, we can derive the recursive formula of

T1 = 1

Tn = Tn-1 + n.

Where Tn is the number of points in the nth pattern and n is any natural number.

Using this recursive formula we could find the number of points in any sequence given the number of the sequence, but it is not convenient. Say we want to find the number of points in...