The triangular numbers are the numbers 1, 3, 6, 10, 15, . . .; the square numbers are the numbers

1, 4, 9, 16, 25, . . . The pentagonal numbers 1, 5, 12, 22, 35, . . .. The geometrical language is
justified by the following diagrams:
a. What are the first five hexagonal numbers? What are the first five septagonal numbers?
What are the first five r-gonal numbers? Give a formula for the nth triangular number.
Give a formula for the nth square number. Give a formula for the nth pentagonal number.
In general, give a formula for the nth r-gonal number.
b. How many numbers can you find that are simultaneously triangular and square? How
many numbers can you find that are simultaneously square and pentagonal?

Pentagonal Numbers

Pentagonal numbers derive from triangular numbers and square numbers by Pn = Tn + S(n + 1). The nth pentagonal number has n sides on the major pentagon it represents. See below.

Order...1.. ......2............................3...............................4
...........O.. .....O............................O..............................O
............. ...O.......O..................O.......O....................O.......O
............... ...O...O...............O....O...O....O...........O...O...O...O
............... .............................O.............O.........O...O...........O...O
................ ..............................O...O...O............O....O..O..O....O
................ ..........................................................O..................O
............... .............................................................O...O...O...O

..........1...........5............................12.............................22
Sides 1...........2.............................3...............................4

I'll let you work out the 5th rank pentagonal number from the next picture of from the general expressions below.

The polygonal numbers derive from the addition of the first n terms of unique arithmetic progressions, all starting with 1.
Counting numbers, Cn, derive from 1 + 1 + 1 + 1 + 1 + 1 + ............... = 1, 2, 3, 4, 5, 6, 7......
Triangular numbers, Tn, derive from 1 + 2 + 3 + 4 + 5 + 6 + ...............= 1, 3, 6, 10, 15, 21, 28 .....= n(n+1)/2
Square numbers, Sn, derive from 1 + 3 + 5 + 7 + 9 + 11+...................= 1, 4, 9, 16, 25, 36, 49 ......= n^2
Pentagonal numbers, Pn, derive from 1 + 4 + 7 + 10 + 13 + 16 + ...... = 1, 5, 12, 22, 35, 51, 70 .....= n(3n-1)/2
Hexagonal numbers, Hxn, derive from 1 + 5 + 9 + 13 + 17 + 21 + .......= 1, 6, 15, 28, 45, 66, 91.....= n(2n-1)
Heptagonal numbers, Hpn, derive from 1 + 6 + 11 + 16 + 21 + 26 + ... = 1, 7, 18, 34, 55, 81, 112.....= n(5n-3)/2
Octagonal numbers, On, derive from 1 + 7 + 13 + 19 + 25 + 31 + ...... = 1, 8, 21, 40, 65, 96, 133.....= n(3n-2)
n-gonal = n[(n-1)n - 2(n-2)]/2 where n = the order number.

(Note the differences between each polygonal number in the same position. That is, the differences between the 2nd numbers are all 1, the differences between the 3rd numbers are all 3, the differences between the 4th numbers are all 6, the differences between the 5th numbers are all 10, the 6th numbers 15, the 7th numbers 21, and so on, the sequence of the triangular numbers.)

Every octagonal number is the difference of two squares.
Example: 21 = 5^2 - 2^2; 40 = 7^2 - 3^2; 65 = 9^2 - 4^2.

You might now notice that the 1st and 2nd triangular numbers add up to the 2nd square number. Similarly, the 2nd and 3rd triangular numbers add up to the 3rd square number. This relationship can be expressed by Sr = Tr + T(r-1) where Sr is the square number of rank r and Tr is the triangular number of rank r. Since Tr = r(r-1)/2 and T(r-1) = (r-1)(r-1+1)/2 = (r-1)r/2, we can write Tr + T(r-1) = r(r+1+r-1)/2 = r^2 and r^2 is obviously the same as Sr.

In the same sense that a square number can be derived from the sum of two triangular numbers, a pentagonal number, Pn, can be derived from the sum of a square number of a particular rank and the triangular number of the previous rank or Pn = Sn + T(n-1). For instance, the 4th pentagonal number P4 = S4 + T3 = 16 + 6 = 22. Similarly, Hxn = Sn + T(n-2).

Similarly, Hxn = Pn + T(n-1), Hpn = Hxn + T(n-1), On = Hpn + T(n-1), and so on.

Another strange relationship between triangular numbers and their squares.
...Triangular....1.......3.......6.......10.......15.......21........28
...Square.......1..... ..9......36.....100......225.....441......784
...Difference........8......27......64......125.....216......343
...Equals.....,....2^3....3^3.....4^3......5^3......6^3......7^3

Thus, from the nth Triangular number, Tn, (Tn)^2 - (T(n-1))^2 = n^3.

The sum of the first three triangular numbers equals the fourth, T1 + T2 + T3 = T4. Would it surprise you to learn that
...T5 + T6 + T7 + T8 = T9 + T10
...T11 + T12 + T13 + T14 + T15 = T16 + T17 + T18
...T19 + T20 + T21 + T22 + T23 + T 24 = T25 + T 26 + T27 + T28 ad infinatum.
The start of each series follows the pattern 1, 5, 11, 19, 29, 41, with the end of each series following the pattern of 4, 10, 18, 28, 40, and so on.

A Triangular Triple results when three natural numbers a, b, c, with a<=b<=c, produce Ta + Tb = Tc. For example, T(14) + T(18) = T(23) where T(14) = 105, T(28) = 171, and T(23) = 276 resulting in 105 + 171 = 276.

Would you believe that the sum of n consecutive cubes, beginning with 1, is always equal to the square of the nth triangular number?

Much more on the subject can be found in the following excellent books:
1--Recreations in the Theory of Numbers by Albert H. Beiler, Dover Publications, Inc., 1964.
2--Mathematical Recreations and Essays by W.W. Rouse and H.S.M. Coxeter, Dover Publications, Inc., 1987.
3--The Book of NUMBERS by J.H. Conway and R.K. Guy, Copernicus/Springer-Verlag, 1996.

The 6th octagonal numbr is 96. Verify this fact using the formula for O n.

a. The first five hexagonal numbers are 1, 6, 15, 28, 45. The first five septagonal numbers are 1, 7, 18, 34, 55. The first five r-gonal numbers depend on the value of "r", which represents the number of sides in the polygon.

For the nth triangular number, the formula is given by n(n+1)/2.
For the nth square number, the formula is n^2.
For the nth pentagonal number, the formula is n(3n-1)/2.
In general, for the nth r-gonal number, the formula is n(2n - 1), where r represents the number of sides in the polygon.

b. There are 4 numbers that are simultaneously triangular and square: 1, 36, 1225, 41616. There are 2 numbers that are simultaneously square and pentagonal: 1, 9801.

a. To find the first five hexagonal numbers, we can use the formula: H(n) = n(2n - 1), where n represents the position of the hexagonal number in the sequence. The first five hexagonal numbers are:

H(1) = 1(2(1) - 1) = 1
H(2) = 2(2(2) - 1) = 6
H(3) = 3(2(3) - 1) = 15
H(4) = 4(2(4) - 1) = 28
H(5) = 5(2(5) - 1) = 45

To find the first five septagonal numbers, we can use the formula: S(n) = n(5n - 3)/2, where n represents the position of the septagonal number in the sequence. The first five septagonal numbers are:

S(1) = 1(5(1) - 3)/2 = 1
S(2) = 2(5(2) - 3)/2 = 7
S(3) = 3(5(3) - 3)/2 = 18
S(4) = 4(5(4) - 3)/2 = 34
S(5) = 5(5(5) - 3)/2 = 55

To find the first five r-gonal numbers, we need to know which value of r represents the desired shape. The formula for the nth r-gonal number is:
R(n) = n((r-2)n - (r-4))/2

For example, the formula for triangular numbers (r=3) is:
T(n) = n((3-2)n - (3-4))/2 = n(n + 1)/2

b. To find the numbers that are both triangular and square, we can set up the equations for triangular and square numbers and find their common solutions. The formula for triangular numbers is T(n) = n(n + 1)/2, and the formula for square numbers is S(n) = n^2.

We need to find the values of n when T(n) = S(n). By substituting the formulas, we have:
n(n + 1)/2 = n^2

Next, we can simplify the equation:
n^2 + n = 2n^2
0 = n^2 - n

By factoring, we get:
0 = n(n - 1)

So, there are two possible solutions: n = 0 and n = 1. Therefore, there are two numbers that are simultaneously triangular and square, which are 0 and 1.

Similarly, to find the numbers that are simultaneously square and pentagonal, we set up the equations for square and pentagonal numbers. The formula for square numbers is S(n) = n^2, and the formula for pentagonal numbers is P(n) = n(3n - 1)/2.

We need to find the values of n when S(n) = P(n). By substituting the formulas, we have:
n^2 = n(3n - 1)/2

Next, we can simplify the equation:
2n^2 = 3n^2 - n
0 = n^2 - n

By factoring, we get:
0 = n(n - 1)

So, again, there are two possible solutions: n = 0 and n = 1. Therefore, there are two numbers that are simultaneously square and pentagonal, which are 0 and 1.