Polygonal numbers as quadratic sequences

I was observing a maths lesson about sequences in a sixth form college. This was pitched at a fairly low level focusing primarily on arithmetic sequences, but a student was having a go at some challenge problems and got stuck on the problem of finding the nth term of the sequence 1, 3, 6, 10, 15, … The teacher asked me to help him. This is a quadratic sequence with first differences 2, 3, 4, 5, … and second differences 1, 1, 1, 1, …. The procedure for quadratic sequences is to divide the second difference by two and use that as the coefficient of n^2. Then compare this resulting sequence with the original one and deduce the other terms. Here the answer is \frac{1}{2}(n^2 + n).

After the lesson I continued to think about this problem and realised that the sequence 1, 3, 6, 10, 15, … is the sequence of triangular numbers. The Pythagoreans associated certain sequences of numbers with polygons, so we have triangular numbers, square numbers, pentagonal numbers, hexagonal numbers, etc. The relationship between these numbers and their associated polygons is clearer to see when the numbers are represented as dots, as in the following diagram:

polygonalnumbers

I noticed that the next polygonal numbers, the square numbers, are also a quadratic sequence, with nth term given by n^2. I wondered if all the polygonal numbers are quadratic sequences.

I could see that the pentagonal numbers 1, 5, 12, 22, 35, 51, … also form a quadratic sequence, with first differences 4, 7, 10, 13, 16, … and second differences 3, 3, 3, 3, … Dividing the second difference by 2 we see that the nth term of the sequence must involve \frac{3}{2}n^2. The following table then reveals what the remaining term must be:

pentagonaltable

Therefore the nth term of the pentagonal number sequence is of the form \frac{1}{2}(3n^2 - n).

It turns out that all the polygonal number sequences are quadratic sequences. To prove this to myself and derive a general formula, I produced the following table in excel showing the first 20 terms of polygonal number sequences from the triangular to the icosagonal (20-sided polygon):

polygonalnumbersexcel

Looking at this table, I noticed that the triangular number sequence which the student had asked me about in the lesson I observed is actually the key to deriving a general formula for the nth term of any polygonal number sequence. Specifically, the table shows that the nth term for the p-gonal sequence is just the nth term for the triangular sequence plus (p - 3) times the (n - 1)th term of the triangular sequence.

For example, the 9th term (n = 9) for the hexagonal sequence (p = 6) is

\frac{1}{2}(9^2 + 9) + (6 - 3)\frac{1}{2}(8^2 + 8) = 45 + 108 = 153

In general, the nth term for the p-gonal sequence is

\frac{1}{2}(n^2 + n) + (p - 3)\frac{1}{2}((n - 1)^2 + (n - 1))

which simplifies to

\frac{n^2(p - 2) - n(p - 4)}{2}