Polygonal and Figurate Numbers or Numbers as Shapes
We call some numbers square numbers because they can be arranged into a square shape. Here we look at other
polygons of dots such as triangles, pentagon and so on - the polygonal numbers.
Such polygons are flat and two-dimensional but we can extend the idea to three and even to
higher dimensions or to other falt shapes that are not regular polygons, such as rectangles or star shapes
and these are called figurate numbers. They have been an object of interest for mathematicians since the
time of the Ancient Greek mathematicians such as
Pythagoras around 500BC
and Hypsicles circa 150BC
and later Diophantus around 250AD and on to
mathematical giants such as
Fermat (1601-1665)
and
Euler (1707-1783).
They still provide an excellent vehicle for spotting intriguing number patterns, proof using algebra at school lever as
well as "proofs without words".
A follow-on page covers polygonal shapes made of sticks or dots arranged centrally and also in 3D shapes
or higher dimensions.
The calculators and other effects on this page require JavaScript but you appear to have switched JavaScript off
(it is disabled) in this browser.
Please go to the Preferences or Properties menu item for this browser and enable it and then Reload this page.
Contents of this page
The icon means there is a
You Do The Maths... section of questions to start your own investigations.
The calculator icon
indicates that there is a live interactive calculator in that section.
Introduction to Number Dot Pictures
Mathematicians from the days of ancient Greeks have always been interested in the properties of numbers that can be arranged
into regular shapes such as a triangle or a square. They are excellent examples to practice
your mathematical skills of spotting patterns, writing the patterns as a formula and then proving the pattern is
always true using algebra. Some examples follow:
One Dimensional patterns - Tally Sticks
One of the earliest uses of "written" numbers was almost certainly to count a number of objects such as sheep in your field.
An early method was to put a notch in a stick or on bone, one for each object, then it was easy to
check later that the same number of objects was there even without any words for the numbers.
If the stick has notches scratched across it, the stick could be split into half and two people have a copy in order
to keep a record of debts or items owed. They were used by the UK Exchequer for centuries
and when the system of keeping records changed in 1826, the old
wooden tally sticks were disposed of, except for some which were discovered later and accidentally
burned down the
Parliament building on 16 October 1834!
This was a simple one-dimensional representation of numbers and may have led to the Roman Numerals.
The problem of designing a shape for a number of dots when you can use 2 dimensions is much more interesting and we
now turn our attention to shapes and then later look at the third - and higher - dimensions.
Number Shapes - in 2 dimensions
First, some examples of where numbers have been represented in a number shape, that is as a 2-dimensional
flat shape. Then we look at the Polygonal Numbers that have fascinated mathematicians since the ancient Greeks
and Pythagoras before we turn our attention to 3 dimensional solid shapes - and then the higher dimensions!
Examples of Number Shape Designs
The Flags of the USA
An excellent example of the problems of arranging a given number of dots into a pleasing shape is the American Flag.
The decision was made early on that the each star in the "stars and stripes" should represent one of the States in
the United States. This has changed often over time and the flag has been redesigned on many occasions.
The first with this format was designed in 1777 and had just 13 stars to represent the 13 states, and then was extended
to 15, 20, 21, 23, 24, ... up to the current 50 stars. The complete
series is in A140646.
Suppose one new state was to be added to the United States, making 51. How would you redesign the stars
to make a nice pattern?
Use this little Calculator to produce a Random Number in some range that you can set (such as up to 20). Suppose the number
generated is
the number of states in a new country and you are given the job of designing a flag with one star (tree, dot, face, ...)
for each of the states. What designs can you invent?
C A L C U L A T O R
random number up to
Or instead of a USA flag, design a banner or flag for
your school Year with a star for
the number of classes in your year (or choose some other symbol instead of a star) OR...
the number of people in your house with a face for each OR...
the number of teams in a local league
Hold a competition and challenge your class or friends to see
who can find the "best" design, decided by those submitting a design voting on the entries.
Playing Cards
There have been several designs for the patterns on playing cards to indicate the numbers
1 to 10. Look at the pattern for 9 and for 7 on this French deck of 1587.
The standard set of cards that you often see now (dating from about 1900) is also shown above
and the images are available for you to use at
Vectorized Playing Cards 1.3-
http://code.google.com/p/vectorized-playing-cards/
(Copyright 2011 - Chris Aguilar
Licensed under LGPL 3 - www.gnu.org/copyleft/lesser.html)
You Do The Maths...
Design your own set of playing cards.
How many suits will your deck of cards have?
♠ ♥ ♣ ♦?
What will you call them?
How many cards will you have in each suit?
In this section we look at how to draw the Polygonal Numbers and some of the relationships between them.
The simplest shape for our Polygonal numbers is a triangle, then we proceed to the quadrilaterals: the square and rectangular numbers
and so on.
Introducing the Polygonal Numbers...
We introduce the numbers which have a triangular pattern, then squares and pentagonal and so on.
If the sides are straight then the shape is "polygonal". For Oblong and Rectangular numbers, not all
the sides have the same length.
Notation for Polygonal Numbers
Let's look at some notation for our polygonal numbers.
Although T(r) is useful because the triangular numbers
appear often when we are examining polygonal numbers, we also need a notation
for all the shapes and sizes of polygonal numbers.
The shape is the number of sides of the polygon and often on this page this
will be n
the size is the number of dots on each side, called the rank
for which we use r
The notation most often used is p
for the Polygon numbers:
pn(r)
means the polygonal number with n sides and the outer side (its rank)
having
r dots. T(r) means the same as p3(r)
The Triangle Numbers
We start with a triangle with a 1 dot,
then a triangle with two dots on each side, giving a shape with 1+2 = 3 dots,
then 3 dots on a side with a total of 1+2+3 = 6 dots,
and so on.
The total number of dots in the shape with side (or rank) r
is the rth Triangle Number.
Because Triangle numbers occur so often when we examine the polygon numbers of all shapes, we will often
use the shorthand notation T(r) for the triangle number with r dots on each side,
e.g. T(3) = 6
Everyday Examples of Triangle Numbers
10 pin bowling
(click to buy these from ROMPA)
15 red Snooker balls
Billiards or Pool
Click on the image to learn more
about the maths of Billiards
Another Example of the Triangle Numbers T(n)
Here's an illustration of the Triangle numbers that is at first not an obvious one for these numbers.
Suppose we have a single line of cars waiting at traffic lights.
As the lights change there may be one or two or more cars that get through each time before they change to STOP.
In how many ways can N cars get through the lights before they change to STOP if at least one car gets through each time the lights are on GO?
There are two obvious cases: they all get through the first time or else perhaps only one gets through each time needing
as many light changes as there are cars, but there are other possibilites too.
For instance, with 3 cars, let's call them A, B and C, we can have:
all through the first time: ABC
two through first and the final one on the second change: AB then C
one through first then the other two on the second change: A then BC
one through each time needing 3 changes of lights: first A then B and finally C
Now let's look at the sequences of cars possible on a single change of lights across all the possibilities above:
ABC,
AB,
BC,
A,
B,
C
making a total of 6 possible sequences of 3 cars passing through
through the lights.
For n cars at lights on a single lane road there are T(n) possible sequences of cars that can pass through the lights
each time the lights are GO
We can put this question in the following form also:
You Do The Maths...
In a set of n consecutive numbers, how many subsets contain only consecutive numbers?
Why is the answer T(n) for a set of size n?
If the numbers are 1, 2, ..., n then
we can choose to start a sequence of 1 number in n ways
we can choose to start a sequence of 2 consecutive numbers in n-1 places
we can choose to start a sequence of 3 consecutive numbers in n-2 places
...
we can choose to start a sequence of n-1 consecutive numbers at 2 places
there is only one way to include all the numbers
So the total number of ways is n+(n-1)+(n-2)+...+2+1 - T(n)
Why is this the same problem as the number of ways of inserting one pair of brackets
in a sequence of n items? For example, for 3 items A, B and C we have:
(ABC), (AB)C, A(BC), (A)BC, A(B)C, AB(C)
The argument is similar to the first question about subsequences of consecutive items in a set:
There can be just 1 or else 2 or 3 or all the way up to all n items within the single pair of brackets.
After we place the opening bracket then, given the size of the collection inside, the closing bracket's place is fixed.
The same reasoning now applies as for the subsets of consecutive numbers above.
In how many ways can I choose 2 items from a collection of different items of size:
3
4
5
100
For n items we can choose the first in n ways.
that leaves n−1 items as the second choice except that if we choose A then B it is the same choice as if we chose B then A.
So each pair will be chosen twice.
The total number of pairs is therefore
n (n−1)
2
The answers are therefore the triangular numbers T(n):
3×2/2 = 3 = T(2)
4×3/2 = 6 = T(3)
5×4/2 = 10 = T(4)
n×(n−1)/2 = T(n)
Can you explain why these two questions are related?
If we take the first and last of each subset of the first question, we will have all the
ways of choosing two from a collection of n (numbers).
For example:
subset 1 2 3 4 5 6 7 8 ⇔ choose items in positions 3 and 7
from 8 items.
The same argument applies if the pairs (ordered with smallest first)
of the second question are used as starting and ending points for the subsets of
the first question.
A Triangular Number Calculator
Here you can find triangular numbers between given limits or else give the ranks of
the triangular numbers (the length of their sides).
We will use the common notation p3(r) to mean the
rth polygonal number with 3 sides. r is called the rank of the triangular number
meaning the length of (the number of dots in) the outside edges.
How many dots are there on an ordinary cubical dice? Why is this a triangular number?
How many dominoes are there in a standard set? Why is this also a triangular number?
If I have a product of n different variables: for example 3 variables
a×b×c in how many ways can I insert one pair of brackets?
E.g. for a b c we have (a)bc, (ab)c, (abc), a(b)c, a(bc), ab(c)
3 variables have 6 correct single bracketted forms and the third Triangular number is 6.
What about a b c d or a b?
The Square Numbers
If we have square shapes for our dotty diagrams, then they each contain a square number of dots
as you might have imagined!
Here they have been drawn with a corner at the top:
A formula for this series is easy - the square with a side of r (its rank) has
r2 dots.
Everyday Examples of Square Numbers
Square arrangements are around us everywhere.
Here we are interested in exact squares - rectangles are considered later - and here are some examples:
Maps
Tiles
Dice
Dominoes
Chess
Graphs
A Square Number Calculator
To find the square of (a range of) numbers, use .
To find if a number is an exact square, use
and put your number in the .
The "up to" number is optional.
Rectangle numbers are those which can be represented as a rectangle a×b.
Unless we want a single line of dots, then both sides are bigger than 1, but
not all numbers are rectangle numbers. Those which are not are called prime numbers.
One of the major problems of mathematics - still unsolved - is to find an efficient way of testing if any number
is prime or not: that is, checking if it has only two factors, 1 and itself. Any number that is not prime
can we written as a product of two numbers (factors), often in several ways. A number not prime is called a
composite number and the numbers that can be multiplied to make that number are called its factors
or divisors.
For instance
12 = 4 × 3 = 6 × 2 so 12 is composite and its factors are
1, 2, 3, 4, 6 and 12 itself.
All composite numbers are Rectangular Numbers.
Prime numbers are the non-Rectangular numbers.
A Rectangular number can be written as a × b but we exclude the single line of
dots and so both a and b must be bigger than 1.
12 =
=
The Rectangular numbers including the Square numbers:
4, 6, 8, 9, 10, 12, 14, 15, 16, 18, 20, ...A002808
These are just the composite numbers, the non-primes, having more than 2 divisors.
The Rectangular numbers excluding the Square Numbers:
6, 8, 10, 12, 14, 15, 16, 18, 20, 21, 22, ...
These are the numbers having an even number n of divisors, n>2.
Everyday examples of Rectangular Numbers
The number of ways of writing n as a Rectangular number
6 has four divisors: 1, 2, 3 and 6
leading to two ways to write 6 as a Rectangular number:
1×6 and 2×3 but
we exclude 1 (and therefore 6 also) because all sides of a Rectangular number must be
bigger than 1.
Thus we have
4 is the smallest Rectangular number and is also square
4 = 2×2;
but 6 is the smallest purely rectangular number (it is not the square of a number).
The first that is rectangular in two ways is
12 = 2×6 = 3×4,
the first that has three rectangular forms is
24 = 2×12 = 3×8 = 4×6;
the first with four rectangular shapes including a square is
36 = 2×18 = 3×12 = 4×9 = 6×6
and the first purely rectangular number with four rectangles is
48 = 2×24 = 3×16 = 4×12 = 6 ×8
the next numbers to break records are:
60 with five rectangular forms 120 has seven forms 180 has eight 360 has twelve 720 has fourteen 840 has fifteen and 1260 has seventeen.
The series above is part of the series of highly composite numbers, where each has more factors than any smaller number:
2, 4, 6, 12, 24, 36, 48, 60, 120, ... A002182.
The smallest purely rectangular numbers (excluding the square numbers) with a given number of rectangles are: 4, 6, 12, 24, 48, 60, 120, 180, 240, 360, ....
and if we include the squares the records are achieved by: 6, 12, 24, 36, 60, 120, 180, 240, 360, ....
I suspect that both series are identical except for
the extra 4 beginning the former and
36 being replaced by
48.
The Oblong Numbers
Another special sub-group of Rectangle numbers, apart from Square numbers, are the Oblong numbers.
These are Rectangular with the
longer side exactly 1 more than the shorter side, that is of the form n (n+1).
If we put two copies of a triangle number together, we get a rectangle of size n (n+1):
1×2=2
2×3=6
3×4=12
4×5=20
5×6=30
This simple series has many applications in its own right.
If we list the squares of every number that ends in 5, can you spot the Oblong numbers
and can you prove your result
using algebra?
n
n2
5
25
15
225
25
625
35
1225
45
2025
55
3025
The squares of numbers ending in 5 are always an Oblong number followed by
25.
(10n + 5)2 = 100 n2 + 100 n + 25 = 100 n (n + 1) + 25
Can you see where the Oblong numbers are
in these runsums?
1 + 2
=
3
4 + 5 + 6
=
7 + 8
9 + 10 + 11 + 12
=
13 + 14 + 15
16 + 17 + 18 + 19 + 20
=
21 + 22 + 23 + 24
...
The highest numbers on the left hand sides are the oblong numbers.
The sum of the n numbers ending at n(n+1) is the same as the sum of the next n-1 integers.
And what about in this pattern:
32 + 42
=
52
102 + 112 + 122
=
132 + 142
212 + 222 + 232 + 242
=
252 + 262 + 272
362 + 372 + 382 + 392 + 402
=
412 + 422 + 432 + 442
...
The left hand sides end with twice an oblong number squared.
Other names for the Oblong numbers are the pronic (or promic) numbers but we will use Oblong on this page.
A Calculator for Square, Rectangular, Oblong and Prime Numbers
When is twice an oblong number oblong? (Check: A098602)
Make a list of those Rectangular numbers which have just a single Rectangular shape. The list
starts with 6, 8, 10. How many can you find less than 100?
What about those with two distinct rectangles, for example 12?
Can you find a method of calculating how many rectangular forms there are for a given number if we exclude
the square numbers?
It will help if you first factor the number into its prime factors and their powers, for example:
✓ 12 = 22 × 31 and it has 2 shapes of rectangle as do
✓ 18 = 21 × 32 and
✓ 20 = 22 × 51 and
✓ 63 = 32 × 71 whereas
✘ 24 = 23 × 31 has 3 different rectangles and so does
✘ 30 = 21 × 31 × 51 but
✘ 72 = 23 × 32 has 5.
What is the average of two consecutive oblong numbers?
The average of n(n-1) and n(n+1) is n2
What is the sum of the reciprocals of the first n oblong numbers?
1
= ?
2
1
+
1
= ?
2
6
1
+
1
+
1
= ?
2
6
12
...
What is the sum of the reciprocals of all of them?
The sum of the reciprocals of the first n oblong numbers is
n
n+1
In the limit the sum of all the reciprocals is 1.
How many ways can I place one square and one domino in a strip of n squares?
For n=4, if the strip has squares numbered 1,2,3 and 4 and [x] indicates the square and
[x y] the domino,
then we have: [1 2][3] 4, [1 2] 3 [4],
[1][2 3] 4, 1 [2 3][4],
[1] 2 [3 4], 1 [2][3 4]
: 6 ways.
What if the strip was of length n=5? n=6? n=7?
Can you justify your answer?
If the strip has positions labelled 1 to n+1 then there are n ways to place the domino because its left-hand square
can go on position 1 or 2 or .... or n.
The domino sits on 2 squares which leaves (n+1)−2 = n−1 places for the square to go.
So there is a total of n x (n−1) ways to place both the domino and the square
and this is an oblong number.
Generalize this pattern using the same oblong number four times and one extra central dot
4 oblongn + 1
= 4 n(n+1) + 1
= 4n2 + 4n + 1
= (2n+1)2
a square with sides of 2n+1 dots.
[Harder: suitable for a Maths Project]
When is the product of two oblong numbers oblong?
Simple examples are two neighbouring oblong numbers (why?), but there are others such as (1×2) × (14×15) = 20×21
Can you identify all of them?
When is the Product of Two Oblong Numbers Another Oblong? Trygve Breiteig
Mathematics Magazine Vol. 73, No. 2 (Apr., 2000), pp. 120-129
[Harder: suitable for a Maths Project]
When is the sum of two oblong numbers oblong?
Simple examples are
(3r)(3r+1) + (4r+1)(4r+2) = (5r+1)(5r+2)
(3r)(3r−1) + (4r−1)(4r−2) = (5r-2)(5r-1) (6×7) + (20×21) = 462 = 21×22
Can you identify all of them?
The Pentagonal Numbers
We can continue with polygons of 5 and more sides. We will keep the pattern of having a "nest" of polygons, all of the same shape,
each one containing the smaller ones inside it, with 2 sides in common with its next smaller neighbour.
They all start from a common corner.
Can you find the hexagonal numbers in this number pattern?
62 + 72
=
92 + 22
152 + 162 + 172
=
192 + 202 + 32
282 + 292 + 302 + 312
=
332 + 342 + 342 + 42
...
Express this series using algebra and prove it.
I have an even number of pencils on my desk. I choose 2 at random. How many different pairs can I choose?
Why is this a hexagonal number?
What if I had an odd number of pencils to choose 2 from?
How are these two series related?
Heptagonal, Octagonal, etc Numbers
The 7-sided polygonal numbers are called Heptagonal:
and so on. In the next section we will find a general formula for the polygonal number with n sides and r dots on the outside
edges.
You Do The Maths...
Make a table of the first few numbers that end in 7.
For each number, square it, then
subtract 9 and finally divide by 40.
What number series do you get?
x
7
17
27
37
47
57
...
squared
49
289
729
1369
2209
3249
...
take away 9
40
280
720
1360
2200
3240
...
divide by 40
1
7
18
34
55
81
...
The last line is the 7-gonal numbers (heptagonal numbers)
Take 3 consecutive numbers with the last one being a multiple of 3,
for example 4×5×6.
Divide their product by their sum. for examples 4×5×6/(4+5+6).
Try this for other sets of 3 such consecutive numbers.
Which polygonal number series do you get?
1×2×3/(1+2+3)
=
1
4×5×6/(4+5+6)
=
8
7×8×9/(7+8+9)
=
21
10×11×12/(10+11+12)
=
40
The octagonal numbers.
Which octagonal numbers are even?
Divide these by 8; do you recognize the series of quotients?
even octagonals
8
40
96
176
280
...
÷8
1
5
12
22
35
...
the pentagonal numbers
Polygonal Number Patterns
The number patterns are already proofs without words but it is not only good practice for algebra
(if you are at school) but also a simple method of proof of the patterns we find in the polygonal numbers.
We see how the shapes interact with the algebra in this section.
A Formula for the Polygon number with N sides and rank R
Hypsicles
in about 175 BC in Greece gives a nice definition of Polygonal Numbers :
If there are as many numbers as we please beginning with 1 and increasing by the same common difference,
then when the common difference is 1 the sum of all the terms is a triangular number;
when 2, a square;
when 3 a pentagonal number.
And the number of the angles is called after the number exceeding the common difference by 2,
and the side after the number of terms including 1
By this he means that we take an arithmetic series, starting at 1, and increasing by the same common difference:
so a difference of 1 gives the series 1, 2, 3, 4, 5, 6,...
and summing these from the beginning gives the series
1, 1+2=3, 1+2+3=6, 1+2+3+4=10, which are the Triangular numbers.
if the difference is 2, starting at 1 we have the series 1, 3, 5, 7, 9, ...
and summing these gives the series
1, 1+3=4, 1+3+5=9, 1+3+5+7=16, ... the square numbers
and so on for differences 3, 4, 5, ...
Finding formulas from number pattern pictures
Here you can have a go at finding the formulas for yourself and then press the
buttons to reveal some hints and answers.
A formula for the Triangular Numbers
Can you find a formula for the Triangle numbers p3(r)?
The triangle with side r
is just the triangle with side r
–1 with an extra row of r dots: p3(r) = p3(r–1) + r
We start with p3(1) = 1, so we can use the recursive formula to find
p3(r) for any r now.
We can find a formula :
If we take two copies of the rth triangle of dots, and put them together like this:
Each Triangle is paired with an identical one upside-down to make a rectangle.
The height of the rectangle is the size (rank) of the Triangle and its width is one longer.
So the two p3(3) triangles of size 6 make a rectangle of
6 + 6 = 3 × 4 and
the two p3(4) triangles of size 10
make a rectangle of 10 + 10 = 4 × 5
and so on.
We can do this with any p3(r) to get a rectangle of
r (r+1) dots.
Since this is made up of
two copies of p3(r), then we have our formula:
p3(r) =
r( r+1 )
2
Two Consecutive Triangles make a Square
Check your Triangle formula by showing that two consecutive Triangle numbers make a Square.
First let's check the numbers in the diagrams above:
The Greek mathematician Nicomachus proved this in 100 AD.
A Formula for the Pentagonal Numbers
Can you find a formula for the pentagonal numbers?
side r
1
2
3
4
5
6
diagram
size p5(r)
1
5
12
22
35
51
Here we use the fact that each polygonal number can be divided up into identical triangles and we now know the
formula for triangle numbers. We take off one side from a Pentagon of rank r, then the rest of the sides are used to make triangles
of sides r-1. Here are the Pentagons above drawn with in this manner:
side
2
3
4
5
6
In each of these patterns we have
one side of the polygon with r points, shown in black
3 coloured triangles having
sides of r–1 dots
or, since a triangle with r–1 dots per side has (r–1)r/2
dots: p5(r) = r + 3 (r–1)r/2
Simplifying this we have:
p5(r) = (3 r – 1 ) r/2
So all Pentagonal numbers of rank 3 or more are Rectangle numbers.
A Formula for the Hexagonal Numbers
The hexagonal numbers can be conveniently squashed into a nice rectangle which makes finding a formula for them
particularly easy:
side
1
2
3
4
5
6
shape
size
1
6
15
28
45
66
rectangle
A rank r hexagon as a rectangle
has height r and width equal to the
r-th odd number 2r – 1 and so we have:
p6(r) = r ( 2r – 1)
Let's now look at the general case and find a general formula.
Calculating the Polygonal Number of shape N and size R
There are several ways of calculating any polygonal number, some quicker than others.
We will first look at using earlier results for smaller values to find the next polygonal number. These
are often the easiest was to calculate answers to many problems.
Then we will look in more detail at one method by which we can find a direct formula for any
polygonal number.
From one to the next - recursive definitions
For many mathematical problems, the easiest way into finding a solution is often to see how we can use a
solution to a smaller problem to solve a larger one.
Here is a table of some of the smaller values of pn(r):
The Polygonal Numbers pn(r)
↓nr→
1
2
3
4
5
6
7
2
1
2
3
4
5
6
7
3
1
3
6
10
15
21
28
4
1
4
9
16
25
36
49
5
1
5
12
22
35
51
70
6
1
6
15
28
45
66
91
7
1
7
18
34
55
81
112
In terms of the COLUMNS, each is a simple Arithmetic progression - the common difference between successive
entries in any one row is a constant.
For r=2 the difference is 1
for r=3 it is 3
for r=4 it is 6
...
the numbers in any column increase by the same triangular number
the triangular numbers are on row n=3
for column r the difference is
p3(r−1) = r(r−1)/2
each column starts on row n=2, where column r starts with number r
So in column r we have
pn(r) = pn-1(r) + r(r-1)/2 for n>2
p2(r) = r.
From here it is quite easy to find a formula for pn(r).
For the ROWS, there is another recursive relationship.
For example, when n=3 we have the triangular numbers, the differences between them are
3-1=2, 6-3=3, 10-6=4, 15-10=5, ...
To get the r-th triangular number we add r to the previous triangular number (of rank r-1):
p3(r) = p3(r-1) + r and p3(1) = 1
But when n=4, the square numbers, the differences are
4-1=3, 9-4=5, 16-9=7, 9, ..., which are just the odd numbers.
The r-th square number is in fact (2r-1) more than the previous one:
p4(r) = p4(r-1) + 2r – 1 and p4(1) = 1
But this is just our old friend from algebra:
r2 = (r-1)2 + 2r-1
We can do the same thing for the pentagonal numbers, but the differences this time are
4, 7, 10, 13, 16, ...
for which a formula is 3r+1 or 3r-2. With a little testing we find:
p5(r) = p5(r-1) + 3r – 2 and p5(1) = 1
We can continue with the other rows by spotting a pattern in these differences.
This is an effective method for computing pn(r). It will find the value for any
n and any r, eventually!
However, it takes quite a lot of work if we have a large value for n or r
since, in effect, we need to know all the values before it on any row or column - unless we can find a formula
which depends only on n and r and not on previous values.
Some formulas for pn(r)
A direct formula means we plug in the values of n and r and can directly compute pn(r)
using simple operations such as +, –, ×, / and powers. When we can find such a formula
it is often the fastest way to compute a value, but for some problems, all we know is a recursive definition. However,
in the case of pn(r), there is a simple formula and it is simple to prove too.
Can you now find a formula for a general polygonal number pn(r)?
A hint for one method is in the colourings of these rank 6 polygons:
p6(6)
p7(6)
p8(6)
The idea of dividing each figure into triangles, as we did for the Pentagonal numbers proof, will work for any polygonal
number, as we see in the diagrams above. pn(r) consists of
a line of r points and
n – 2 triangles of side r – 1 dots.
the triangle number with r–1 dots per side is (r–1)r/2 .
pn(r) = r + ( n–2 )
( r–1 ) r
2
Here is a table and another way of deriving alternative forms for pn(r) by generalizing
patterns across the rows or down the columns:
We now have these formulas for the Polygonal number pn(r)
of n sides and size r (that is the number
of dots on each of the n outer sides):
pn(r) =
r
(n – 2 ) r – n + 4
2
(A)
=
r
(r – 1) n – 2r + 4
2
(B)
=
n
r (r – 1)
– r (r – 2)
2
(C)
=
r + (n – 2)
r (r – 1)
2
(D)
=
r
(2 + (n − 2)(r −1))
2
(E)
=
r (r + 1)
+ (n – 3)
r (r – 1)
2
2
(F)
=
(n – 2) r2 – (n – 4) r
2
(G)
We will refer to these equations later using the names (A) to
(F). Some simple algebra will show that they are all the same formula.
(A) and (B)
show that pn(r) is always a multiple of its rank when the rank is odd
and is a multiple of half the rank if the rank is even.
(C), (D) and (F) derive pn(r) from multiples
of triangular numbers.
(D) was derived in the section A formula for pn(r) just before the table above
where we saw that pn(r) is
n–2 triangles and an extra r dots,
forming one side of the polygon.
(E) is derived simply from (D) to make a useful formula for testing if a given number is polygonal
— see When is a Number Polygonal? below
(F) tells us that any polygonal number is a (simple)
linear combination of two neighbouring
triangle numbers.
Alternatively, each polygonal number is made from n–3 copies
of the triangle number from the previous column, rank r-1, to which we add
the triangle number from its column (rank r).
(G) is the quadratic in r that we must solve to find if a given
number is a polygonal number of shape n.
There are some recursive formulas too:
pn(r) =
pn−1(r) + r(r – 1)/2 = pn−1(r) + p3(r−1) if n>2
(R1)
p2(r) =
r
pn(r) =
2 pn(r – 1) – pn(r – 2) + n – 2 if r>1,
(R2)
pn(0) =
0
pn(1) =
1
pn(r) =
p3(r) + (n−3) p3(r−1) if n>3, r ≥ 1
(R3)
p3(r) =
r(r+1)/2 if r ≥ 0
pn(r) =
(n−2) p3(r−1) + r if n ≥ 3, r > 0
(R4)
p3(0) =
0
(R1) was given by Nicomachus
around 100 AD although in the form of words not an equation:
To the previous figurate number of the same rank and one fewer side (the one above it in the table),
we add the triangular number from the previous column.
So all figurate numbers in the same column (with the same rank) form an
arithmetic series with constant difference that is the triangle number of the previous column.
(R2) defines a figurate number in terms of smaller sized ones of the same shape
(R3) defines all figurate number in terms of triangular numbers.
Mentioned by C G Bachet in 1621 (see references at the end of this page: Dickson vol II page 5).
(R4) follows from (R3) because p3(r) = p3(r−1)+r
(see Deza and Deza page 22)
A Calculator for Polygonal Numbers
This Calculator will find numbers in a given polygonal series that in
a given range. The other Calculator below will find much more,
including numbers common to several polygonal series, which shapes
of polygon a given number has and ways of representing numbers as
sums of polygonal numbers.
Several of the patterns we have seen above are just "Proofs without words" in that they demonstrate a mathematical property
true for an infinite collection of shapes though the picture is of just one example.
Such patterns can also be verified quite easily using algebra and applying
the formula for pn(r).
Here you will find various pictures showing
patterns in the polygonal numbers using colours. Your job is to express the pattern using the language of mathematics
and then, using algebra and
formulas of the previous section, to provide a proof that your pattern formula is correct.
For each pattern, write the general pattern using mathematics and show that the components in different colours sum to the
number of dots in the whole polygon.
Complete Graphs
If we draw n points round a circle and join them with straight lines
in all possible ways, how many lines are there?
Such diagrams are called Complete Graphs
or Complete Networks and are denoted Kn.
← Show a diagram of
all lines connecting
points
From one triangle number to the next
2 + T(1) = T(2)
3 + T(2) = T(3)
4 + T(3) = T(4)
5 + T(4) = T(5)
Here is an example answer:
n + T(n-1) = T(n)
Using the basic formula for T(n):
T(n) = ½ n(n+1) we have:
T(n-1) = ½ (n-1) n The left-hand side of our formula, with T(n-1) from above, becomes:
n + T(n-1) = n + ½ (n-1) n
n + T(n-1) = ½ (2n + (n-1) n )
n + T(n-1) = ½ (2n + n2 - n )
n + T(n-1) = ½ (n2 + n )
n + T(n-1) = ½ n ( n+1 )
but this is the formula for T(n)
n + T(n-1) = T(n) so our proof is complete
3 Triangles plus the previous one
3 Triangles plus the next one
From one square to the next
1 + 01 = 12
3 + 12 = 22
5 + 22 = 32
7 + 32 = 42
9 + 42 = 52
Summing the whole numbers up and down
1
1+2 +1
1+2+3 +2+1
1+2+3+4 +3+2+1
1+2+3+4+5 +4+3+2+1
1+2+3+4+5+6 +5+4+3+2+1
Summing up the odd numbers
1
1+3
1+3+5
1+3+5+7
1+3+5+7+9
1+3+5+7+9+11
Two triangles plus a line
1
2 + 2×1 = 4
3 + 2×3 = 9
4 + 2×6 = 16
5 + 2×10 = 25
6 + 2×15 = 36
8 Triangles plus a dot
1 + 8 T(1) = 32
1 + 8 T(2) = 52
1 + 8 T(3) = 72
1 + 8 T(4) = 92
1 + 8 T(5) = 112
A Square with a triangle on one side
1
4+1=5
9+3=12
16+6=22
25+10=35
36+15=51
Summing the n numbers starting from n
1
2+3
3+4+5
4+5+6+7
5+6+7+8=9
A square with two triangles on its sides
1
4 + 2×1 = 6
9 + 2×3 = 15
16 + 2×6 = 28
25 + 2×10 = 45
36 + 2×15 = 66
You Do The Maths...
Choose one of the Complete Network diagrams above.
To make it into a piece of art for your wall or shelf you can draw it on a piece of stiff paper
such as black paper and use a silver-based gel pen for the lines.
But how about making it from wood, nails and a reel of cotton as follows:
On a piece of solid wood, which you might like to paint black to begin with,
draw a circle and mark out the number of equally-spaced points on its circumference
for the diagram you have chosen.
Carefully knock a nail into each point.
Wrap white cotton, string or wire round the nails to join each nail to every other nail to
make your own copy of the diagram.
What diagrams do you get if the n points are equally placed around the outside of a square and each point is joined
to all the others?
Is it possible to draw the complete diagram Kn without
taking your pen off the paper or by never cutting the cotton wrapped round the nails in the exercise above
if you never go over any line twice?
Hint: Consider the simple cases such as K3 - is it possible?
What about K4? and K5?
K3, a simple triangle, is possible;
K4, a square with both diagonals, is impossible
After that, all complete networks on an odd number of points are impossible and all with an even
number of points are possible.
Euler proved a very simple theorem to test any network of points and lines joining them to see if it could be
drawn without taking the pen off the paper. Such a continuous line is call an Eulerian circuit
if the single line you draw starts
and ends at the same point or else it is an Eulerian path if all the lines are drawn
but you end up at a different point to the one
you started from.
What is Euler's Theorem? (It is surprisingly simple!)
Count the number of lines that meet at each point. If they are all even, then it is possible to find
a continuous path using all the lines once only, starting at ending at the same point.
If there are just 2 points with an odd number of lines meeting at them, then a path is possible starting at
one and ending at the other.
In all other cases it is impossible to find a continuous path using every edge just once.
How can you apply it to the Kn networks and decide if we can or
cannot draw it without taking the pen off the paper?
In Kn, all points are joined to all others so each of the n points has n-1 lines meeting at it.
So, if n is odd, all the points have an even number of lines meeting and so a single path through
all is possible.
If n is even, then each point has an odd number of lines meeting there and so since n is even and 2, all
Kn for even n are impossible.
Curve Stitching
From a point P on the page draw two lines at any angle to points Q and R.
Mark a number n of equally spaced points on each line PQ and PR, the same number on each.
Knock a pin or nail into each of the n points on the two lines.
Using thread and ignoring the point P, join the outermost point on one line to innermost point on the other and repeat
with the remaining points.
Originally, these were made using a needle and thread to stitch the lines through holes in the card or else
using string or a gold or silver coloured wire wrapped round nails on wood. The straight lines produced
a curve as an envelope of the stitched lines, hence curve stitching.
In the diagram here n=7 with the two original lines in black and the string shown in red.
How many points are there where the string crosses itself, excluding at the pins.
Note that nowhere do we have three or more string lines crossing.
If we look at all the lines in the diagram, the original two and the ones made by the string,
how many points are there where two or more lines meet?
Now count the regions made by the string. How many are there between your two lines?
Show a triangle of
layers
Here is a well-known puzzle that appears often in puzzles and competitions. How many triangles are there in this diagram (of 4 layers of Δ triangles)?
You should be able to answer it now that you know all about Triangle numbers.
The answer is complicated by there being are both Δ triangles and "upside-down" triangles ∇
and each being present in a variety of sizes.
But by counting all the sizes of Δ
triangles and then separately considering the ∇ ones
you should be able to solve the puzzle for small values of n.
Suppose there are n layers of Δ triangles.
There are T(n) basic (size 1) Δ triangles.
If we group 4 Δ triangles together to make a Δ-triangle of 2 layers,
by considering the top-most triangle of each, we see there are
T(n–1) of these within the whole diagram.
We can repeat this with sub-triangles that are 3, 4, ... and up to n layers.
There is just one triangle of n layers.
Adding up all these we get:
T(n)+T(n–1)+...+T(2)+T(1) =
n (n + 1) (n + 2)
6
This gives a total of 4 for the 2-layer triangle, 10 for the 3-layer and 20 for the 4-layer, etc.
As to "upside-down" ∇ triangles, there are T(n–1) single triangles.
However, if n≥4 there are T(n–3) ∇ triangles made from 4 single ∇
triangles -
because we cannot use the top two layers in the diagram nor the lowest layer to be the top of a 2-layer ∇ triangle.
We must have at least 2n layers for there to be a ∇-triangle of n layers. The diagram of 6 layers is the first to have
a 3-layer ∇-triangle and then it has only the one.
The total number of ∇ triangles of all sizes in an n-layer Δ triangle is: 2:1, 3:3, 4:6+1=7, 5:10+3=13, 6:15+6+1=22
The total number of Δ and ∇ triangles of all sizes in a Δ triangle diagram of n layers is:
All numbers k are polygonal in a simple way:
as a polygon with 2 dots on each of its k sides, that is,
of rank 2, because:
k = pk(2) for all numbers k>0
But what about numbers which are polygonal of rank greater than 2? But what about other shapes?
Can we find a method for deciding if a given number is, for example, a triangle number or
a pentagonal number? Given a number, is there a method we can use to find all its shapes and sizes?
How to find all the ways a given number is Polygonal
The collection of Polygonal numbers of rank r>2 begins as follows:
So not all numbers are Polygonal if we consider only those with rank r>2.
If we include rank 2 also, then every number n is polygonal in at least one way (a polygon of n sides whose rank is 2).
If we count the number of polygonals for 3,4,5,... we have the series
When is k a Polygonal number?
Given a value of k, how can we find
n and r for which
k = pn(r)?
The Greek mathematicians from Pythagoras and onwards, including
Diophantus,
(approx 200 AD to 284 AD) started to explore
this problem but did not find a method. They were using only geometry but we will
use algebra together with the formulas above for pn(r) to find a solution.
Our method is essentially that of G Wertheim of 1897
(see the reference below, volume II, Diophantine Analysis,
page 3).
From formula (E) above we have:
pn(r) =
r
(2 + (n − 2)(r −1))
2
Given the value of k, to find n and
r such that k = pn(r) using the formula
2 k
= 2 + (n − 2)(r −1)
r
So our first step is to double the given number k and find its factors, because from this formula, one of them is
r. We only want factors
2 k = a × b and
r is the smaller of the two factors so, since the minimum rank for a
polygonal bigger than 1 is 2, the
smallest factor must be 2 or more.
First make a list of each pair of factors of 2 k = a×b where
a ≤ b:
Take for example, k = 28.
2 k = 56
= 2 × 28
= 4 × 14
= 7 × 8
The method is:
take a factorisation with the smaller factor being r and the larger factor call F
take 2 from F
If F-2 is divisible by (r−1) then this value is n-2
Add 2 to find n
Ways in which 28 is polygonal
2K =
factors= r ×F
F-2
(F-2)/(r-1)=n-2
n
pn(r)=K
58 =
2×28
26
26/1=26
28
p28(2) = 26
4×14
12
12/3=4
6
p6(4) = 26
7×8
6
6/6=1
3
p3(7) = 26
28 is polygonal in three ways
p28(2)
p6(4)
p3(7)
NOTE that sometimes a factorisation of 2k produces a value of
n that is not an integer, for example when k=12:
Ways in which 12 is polygonal
2K =
factors= r ×F
F-2
(F-2)/(r-1)=n-2
n
pn(r)=K
24 =
4×6
4
4/3
-
-
We reject those cases but the great mathematician Euler did look into Polygonal numbers of fractional size!
You Do The Maths...
There are two more numbers smaller than 28 that can also have 3 polygonal shapes. What are they?
What is the only number less than 40 that has 4 polygonal shapes?
How to check if a given number has a particular polygonal shape
We could just use the method in the previous section to find all the ways that a given number is polygonal then check
to see if a particular shape was in that list. But if you want to see if a number is of a particular shape,
there is a test that does not involve factoring numbers. It is left as
an exercise for the reader to use one of the pn(r) formulas
above and rearrange it to find r given n
and the number pn(r).
pn(r) =
r( (n–2)r – n + 4 )
2
we are given p (let's use this to stand for pn(r))
and the shape of the polygon n and we want to find r
if the number p is indeed in the series of n-gonal numbers.
Rearranging:
2 p = (n – 2) r2 – r (n – 4 ) ⇒
(n – 2) r2 – r (n – 4 ) – 2 p = 0
and we have a quadratic in r which we can solve to get:
r =
(n - 4) ± √
(n - 4)2 + 8 p ( n – 2)
2 ( n – 2)
The part under the square-root is bigger than (n - 4)2 so taking
the – sign before it would make r negative.
So we have this formula for the value of r
that we sought:
r =
(n - 4) + √
(n - 4)2 + 8 p ( n – 2)
2 ( n – 2)
It will only give a whole number if:
the value under the square-root is positive
the value under the square-root IS a square number
the numerator is an exact multiple of the denominator
If any of these conditions fail, then our given value of p is
not an n-gonal number.
Is every number the sum of Polygonal Numbers of one shape?
Since 1 is the first polygonal number of any and every shape, then we can add n 1's to make any number n!
But here we ask if there is
a fixed number of polygonal numbers of the same shape - a list of a limited size - whose sum is any number whatsoever?
Sums of Triangular Numbers
Let's use the shorthand notation T(r) for the rth Triangle number:
T(r) = p3(r) = r(r+1)/2
You Do The Maths...
If we take two copies of T(2) = 3,
we have 6 dots which we can make into a single Triangle number because 6 = T(3).
Can you find any more Triangle numbers that, when doubled, make another Triangle number?
See A075528 for answers.
10 + 45 = 55 is also T(4) + T(9) = T(10)
Which are the Triangle numbers that can be added to one triangle number to give the next triangle number?
We can add 5 to T(1)=1 and to T(4)=10
to get the triangle numbers T(3)=6 and T(5)=15
but 5 is not a triangle number.
Can you find a triangle number that can be added to two triangle numbers to get two more?
Find a triangle number which you can add to at least 3 other triangle numbers and each time the total is
a Triangle number.
Can you find one number that is not the difference between two triangle numbers?
One of the number patterns above showed us that if we
add two consecutive Triangle numbers we will always get a square,
For example
T(2) + T(3) = 3 + 6 = 9 = 32
This investigation asks you to find pairs of Triangle numbers that are not consecutive and yet whose sum is a square.
For example,
Find some more Triangle numbers which are square when T(2) = 3
is added to them. Can you find a formula or other patterns in these numbers?
Try the same thing but using another Triangular number in place of T(2) = 3.
Is it always true that there are an infinite number of Triangle numbers that, when added to a given Triangle number
result in a sum that is square?
Can you find dot diagrams for any of your results?
Find two different triangular numbers that add together to make another triangular number.
Do you think it is true that for every triangular
number there is always another which can be added to it to make a third?
If so, write down a formula for your pattern
and use the T(n)=n(n+1)/2 formula to prove it is true.
Instead of adding two triangle numbers,
this investigation is about multiplying two different Triangle numbers to make a square.
For instance,
T(2) × T(24) =
2×3
×
24×25
= 3×12×25 = 302
2
2
Are there more Triangle numbers that when multiplied by T(2) = 3 are square?
What if you used another Triangle number instead of T(2) = 3?
What patterns and formulas can you find?
T(1) + T(2) + T(3)
=
T(4)
T(5) + T(6) + T(7) + T(8)
=
T(9) + T(10)
How does the pattern continue?
Can you find a formula for the left-hand sides and for the right-hand sides and prove they are equal?
This problem is quite hard!
Find pairs of Triangular numbers whose difference and whose sum are also triangular numbers,
e.g. T(5) = 15 and T(6) = 21.
Their difference is T(6) - T(5) = 21 - 15 = 6 = T(2)
and their sum is T(6) + T(5) = 21 + 15 = 36 = T(7)
Such pairs are not too common, but the next pair are both less than 1000.
This problem was posed by J Ozanam in 1696 and he found 3 pairs.
The third pair of numbers are each 7 digits long and this is a long time before mechanical or electronic calculators
were invented!
What numbers are possible if we add Triangular numbers?
The fascinating answer is "They all are!" and that we need no more than 3 triangular
numbers in the sum to make any number we like!
This had been suspected for a while but it was Gauss (1777-1855)
who famously wrote in his diary on
10 July 1796:
ΕΥΡΗΚΑ! num = Δ + Δ + Δ!
or, as we might say,
"I've found it! Every number is the sum of 3 triangular numbers! ".
He had found the first proof.
Some numbers are triangular already
we know all the squares are the sum of two consecutive triangular numbers
but Gauss's proof
is that you can represent every number as a sum of no more than 3 triangular numbers
Did you notice from his dates that he was only aged 19 at the time he proved this?
The result was indeed true, but even Euler could not find a proof although he found many relationships
between the Polygonal numbers. It was not until
Gauss
published his Disquisitiones Arithmeticae in 1801
(see the English translation below: )
that the first proof appeared in print as article 293. He writes (translated):
the previous arguments also provide a demonstration of that famous theorem:
any positive integer can be decomposed into
three trigonal numbers. It was discovered by Fermat but until now there has been no rigorous proof
for it.
The Sum-of-Triangular-Numbers Representation Calculator
Now make a list of as many numbers as you can, writing each as the sum of
no more than 3 triangular numbers.
Some numbers need 3 Triangular numbers in their sum - they are neither triangular not
can they be made by adding two triangular numbers. For instance 5=1+1+3 and 8=1+1+6
are not the sum of any smaller lists of Triangular numbers.
Check that the next two are 14 and 17 and then find the next two numbers. Hint: make a list of all the numbers found by adding two triangular numbers from the list 0,1,3,6,10,... .
Check your answer here:A020757
Sums of Square Numbers
We have just seen that
all numbers are the sum of at most 3 triangular numbers, proved by Gauss when a young man.
So what about square numbers? Are all numbers a sum of some squares?
Two Squares sum to make another square - Pythagoras!
The problem of finding two squares whose sum is another square is a famous problem since Pythagoran
Pythagoras' Theorem says:
If the sides of a right-angled triangle are a, b and the longest side (the hypotenuse)
has length h then a2 + b2 = h2
There is much more on this problem on my Pythagorean Triangles and Triples
page on this site, so we will leave the reader to investigate this problem separately.
Some numbers need more than two squares
It turns out that we need at least four squares then we can find a sum of squares for any number:
No smaller number of squares will do.
If the next is 28 which 4 squares sum to 28?
The series is 7,15,23,28,31,39,47,55,60,...A004125.
You Do The Maths...
Can you find a number that needs 5 or more squares?
What about the Pentagonal Numbers 1,5,12,22,35,...?
What is the smallest size that
you can find so that every number will be the sum of a set of Pentagonal's of that size?
The answers are in the next section.
Sums of same shaped figurate numbers
In this section we will take a closer look at sums of figurate numbers where both the numbers summed and the total
are of the same shape.
Is it possible that two triangular numbers can sum to a triangular number? What about squares? and Pentagonals and
other shapes of polygon?
We can easily see an example for triangular numbers since:
3 + 3 = 6 : p3(2) + p3(2) = p3(3)
If we want to insist on two different numbers, then we have
6 + 15 = 21 : p3(3) + p3(5) = p3(6)
and for squares we recognize this as the Pythagorean Triangle property (two squares sum to a third) and
we have already seen that there many results, for example
9 + 16 = 25 : p4(3) + p4(4) = p4(5)
For the other polygonal numbers, a little searching reveals the following:
Did you spot a pattern in the ranks for three different numbers of the same shape?
pn(r1) + pn(r2) = pn(r3)
n
r1
r2
r3
3
2
2
3
4
3
4
5
5
4
7
8
6
5
11
12
7
6
16
17
Can you guess how the table continues?
Can you put this pattern into an algebraic equation and verify it?
The table continues:
pn(r1) + pn(r2) = pn(r3)
n
r1
r2
r3
8
7
22
23
9
8
29
30
10
9
37
38
and the pattern is:
using T(r) = p3(r) = r(r+1)/2:
r1 = n - 1
r2 = T(n - 2) + 1
r3 = r2 + 1 = T(n - 2) + 2
or, as a single formula:
pn(n - 1) + pn( T(n - 2) + 1) = pn(T(n - 2) + 2)
We have just proved that
It is always possible to find two n-gonal numbers whose sum is a third n-gonal number
and, by rearranging the terms:
It is always possible to find two n-gonal numbers whose difference is a third n-gonal number
We have seen that 2 p3(2) is triangular : 2 p3(2) = p3(3) : 3 + 3 = 6 and also 2 p5(5) = p5(7) : 35 + 35 = 70 .
There are no solutions to 2 p4(r) = p4(s) : 2 r2 = s2
or else √2 would be r/s, a rational number.
Find a simple proof that √2 is irrational (search the web)
Extend your proof to show √3 is irrational
Investigate the polygonal number table or use the calculator below
to find other values of n for which
2 pn(r) = pn(s)
What about products? For which n, if any, are there n-gonal numbers whose product is n-gonal?
This clearly applies to squares since a2 × b2 = (ab)2
but are there other shapes too where
pn(a) × pn(b) = pn(c)?
For a particular shape (n-gon), does the pattern in the table above continue?
If it does, it will show that there an infinite number of such tripes for each shape
If so, show how and what the formula is.
Some of the investigations here are better answered if we can determine directly is a given number has a certain shape.
Let's have a look now at how to do that.
Fermat gives the answer!
The mathematician Fermat
(1601-1665) in one of his notebooks wrote:
I was the first to discover the very beautiful and entirely general theorem that
every number is either triangular or the sum of 2 or 3 triangular numbers;
every number is either a square or or the sum of 2, 3 or 4 squares;
either pentagonal or the sum of 2,3,4 or 5 pentagonal number;
and so on ad infinitum...
Also, just as he did with his famous "Fermat's Last Theorem" he wrote:
I can not give the proof here...
for I intend to devote an entire book to this subject and to
effect in this part of arithmetic astonishing advances over the previous
known limits
Unfortunately, the book never appeared but he did state this "theorem" also in letters
to Mersenne in 1636 and to Pascal in 1654. [See references below to Dickson, Vol II, page 6].
What Fermat found is a very interesting result that, if we include the number 0 as a polygonal
number of any shape:
Every number is the sum of 3 triangular numbers
Every number is the sum of 4 square numbers
Every number is the sum of 5 pentagonal numbers
and so on for every shape of polygonal number
This was first proved by Cauchy in 1815 (see History of the Theory of Numbers, vol II page 18)
who also established that all but 4 of the polygonal numbers may be taken to be 0 or 1.
In fact, for larger numbers, the situation is a good bit simpler than this very nice and easily remembered
theorem, because Legendre proved that
beyond a certain value of n
every integer is a sum of just 4 p-gonal numbers when p is odd
and, when p is even,
every even integer big enough is a sum of just 5 and one of them is
either 0 or 1.
If p is odd:
Every integer bigger than
28(p–2)3 can be written as a sum of 4 p-gonal
numbers
If p is even:
all integers bigger than 7(p–2)3 can be
written as a sum of 5 p-gonal
numbers , one of which is 0 or 1.
The limits
p:
3
4
5
6
7
8
...
odd p limit
28
756
3500
...
even p limit
56
448
1512
...
The Polygonal Number Sums Calculator
The representations of a number n here are lists of up to p p-gonal numbers with sum n.
Pythagoras' theorem applies to square number - two square numbers whose sum is a square. The final section
of this Calculator lets you extend this to find two triangular numbers whose sum is triangular or to
two pentagonswith pentagonal sum
and to any other polygonal shape.
C A L C U L A T O R : P o l y g o n a l N u m b e r S u m s
Find representations
Find numbers with several representations
with
representations of
The size of the smallest representation
whose smallest representation has
Generalising Pythagoras' theorem to polygonal numbers
two numbers and their sum all of which are
The counts of the number of ways of writing n as a sum of up to 3 triangle numbers are : 1, 1, 1, 2, 1, 1, 2, 2, 1, 2, 2, 1, 3, 2, 1, ... A002636
The 11 numbers that are the sum of just one set of up to 3 triangle numbers (all are less than 100). 0, 1, 2, 4, 5, 8, 11, 14, 20, ...See A060773.
The 38 numbers that are the sum of exactly 2 sets of up to 3 triangle numbers (all are less than 200). 3, 6, 7, 9, 10, 13, 15, 17, 18, 19, 23, ... See A071530.
Square Numbers:
The number of sets of (up to 4) squares with a sum of n is 1,1,1,2,1,1,1,1,2,2,1,2,2,1,1,2,2,3,2,2,2,...A002635
Those numbers which are the sum of just one set of (up to 4) square numbers are: 1,2,3,5,6,7,8,11,14, 15, 23, 24, 32, 56,...A006431
Those which are the sum of exactly two such sets are: 4,9,10,12,13,16,17,19,20,21,22,...A180149
Pentagonal Numbers:
Surprisingly, there are only 6 numbers that need 5 Pentagonals in their sum and all are less than 100.
9, 21, 31, 43, 55, 89
Hexagonal and higher
There seem to be a very small number of numbers that need p p-gonal numbers when
p is 5 or more.
So Triangular and Square numbers are unusual in that there is an infinite list of numbers
that need 3 Triangulars or that need 4 Squares in their sums.
Here are some more suggestions to start your own investigations:-
You Do The Maths...
Make a list of the triangular numbers squared: p3(r)2
which begins 1, 32=9, 62=36, 102=100, ...
What do you notice about the difference between one and the next?
They are the cubes
1
9
36
100
...
8=23
27=33
64=43
...
Can you now write down a formula for
13 + 23 + 33 +
... + n3 ?
13 + 23 + ... + n3 = p3(n)2
If you add two neighbours in the list of squared triangular numbers, what do you notice (hint: look in the list of
triangular numbers)?
p3(r−1)2 + p3(r)2 = p3(r2)
There are n people in a room, and each shakes hands with everyone else when they are
introduced. How many handshakes were there?
In a chess club (tennis, snooker, pool or any other two-person game) n
people arrive for a tournament where
everyone plays everyone else once.
How many games are played in the tournament?
Two people are needed to serve on a committee out of n possible candidates.
In how many ways can the two people be chosen?
What is the average of the first n Pentagonal Numbers?
A Talent Competition starts with
n acts, each judged by a panel of judges.
After each round the judges decide on
one act to be eliminated from the rest of the competition. Then the remaining acts compete again in the next round
until there is only one act remaining - the winner.
If there is one round each week, how many weeks will the competition last?
How many performances in total will the judges have seen?
Why is the answer to all these a Triangular number?
Harder:
The list of numbers that need 4 squares is infinitely long. Use the Polygonal Sums Calculator
to find some by using
whose smallest representation has
-gonal numbers
with sum =
up to
There is a simple condition to test if a given number is in this list:
First divide by 4 as often as you can
then divide what is left by 8 and look at the remainder.
What is the test condition?
Take any pentagonal number p5(r); let's call it P.
Either factorize or find the roots of the quadratic 3 x2 − x − 2 P .
What do you notice about the factors (roots)?
What about the quadratic x2 − x − 2 p6(r) for different values of r?
Can you find any other similar quadratics?
Multi-polygonal numbers
Can we find numbers that are both triangular and square?
How about a number that is both triangular and square and also pentagonal?
The answer to the first is YES we can find an infinite number of them
but for the second question there are none!
This section explores numbers that have more than one shape - multi-polygonal numbers.
A Triangle Number that is also a Square
Can you arrange the four pieces of the triangle on the left to make a square?
Here is a nice animation of the transformation:
Can we find any Triangle Numbers that are also Square numbers?
You Do The Maths...
Apart from the number 1, find some more numbers that
can be arranged into a triangular shape and also into a square. Hint, there is another less than
50:
What are the triangle ranks of these numbers? Is there a pattern?
1, 8, 49, 288, 1681,...A001108
You may have noticed that the n-th triangular rank is 6×(n-1)th – (n-2)th + 2.
What are the sizes (ranks) of the squares?
Can you find a simple recurrence relation to fit this series?
1, 6, 35, 204, 1189, ...A001109
The n-th square rank is 6×(n-1)th – (n-2)th.
Sometime the sum of the first n numbers is a square number m2. For instance,
1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 = 36 = 62
How are the solutions for m related to the triangular square numbers?
How are the solutions for n related to the triangular square numbers?
If the sum of the first n numbers is m2 then both these quantities are triangle numbers that are square.
The values of n are the triangular ranks and the values of m are the square ranks.
There is a formula for the triangular square numbers, but the recurrence relations given in the above
You Do The Maths... are easier
(17 + 12 √2)n + ( 17 – 12 √2)n – 2
32
It looks as if this formula shouldn't give whole number solutions, but it does!
A Square number that is also Pentagonal
Here is a nice jigsaw which can either make a square or else a pentagon. (Click on the image to buy this puzzle).
But if we use dots and pentagon numbers, can you find a square number which can be rearranged to make a pentagon too?
.. and we exclude 1 as it is always the "first" Polygon number no matter what shape we have!
[HINT: You will have to search Pentagonal numbers up to 10,000 to find the first!]
9801 = p4(99) = p5(81)
There are more... the next being 94109401. The series continues: A036353
What about other combinations such as Triangular numbers that are also Pentagonal?
Here is a page of other
jigsaw dissections for polygons. Do they also have equivalents in Polygonal Numbers?
Triangular numbers that have another polygonal shape
Here is a table summarising which triangular numbers are square, or pentagonal, or another p-gonal shape:
Other numbers polygonal in two different ways can be found in the Calculator below
We can also look for numbers which have 3 polygonal shapes...
Is there a triangular number that is both square and pentagonal?
Apart from the obvious number 1, computer searches up to
1022166 (which is 1 followed by 22166 zeroes) have not found any.
The Mathworld link below points to a proof method that indicates there are indeed none except the number 1.
The smallest numbers polygonal in n ways for n=1,2,... are
3, 6, 15, 36, 225, 561, 1225, 11935, 11781, 27405, ... A063778
Not all pairs of polygonal shapes have common numbers. For instance,
no numbers exist that are both triangular and 11-gonal
Such impossible pairs are detected in the Calculator above. Then, if not impossible,
the Calculator searches for numbers common to all the given shapes.
See if you can spot the rule for impossible-pairs. Here is a list of all the smaller pairs of
polygon shapes that have no numbers in common:
3 and any of: 11, 18, 27, 38, 51, 66, 83. ...
4 and any of : 10, 20, 34, 52, 74, 100, ...
5 and any of: 14, 29, 50, 77, ...
6 and any of: 11, 18, 27, 38, 51, 66, 83, ...
7 and any of: 22, 47, 82, ...
8 and any of: 26, 56, 98, ...
9 and any of: 30, 65, ...
10 and any of: 20, 34, 52, 74, 100, ...
Check your answer with this reference article:
Numbers common to two Polygonal Sequences D S Lucas, Fib Q 11 (1973), page 80-84
see pdf version.
Runsums and Polygonal Numbers
A runsum is a number which is the sum of a run of (consecutive, positive) whole numbers,
for example: 12 because 12 = 3 + 4 + 5.
The sum of the whole numbers from a to b, b≥a, we will write as runsum(a,b) = a + (a+1) + ... + b and it uses
b − a + 1 numbers in the sum, called the length of the runsum.
There is a lot more on these numbers on the introductory page on runsums at this site.
All odd numbers are runsums since 2n + 1 = n + (n+1).
We have already seen that the triangular numbers are the sum of consecutive numbers starting at 1:
T(r) is the sum of the first r numbers beginning at 1.
Triangle differences: the Trapezoidal Numbers and Runsums
If we sum a succession of whole numbers, we have the sum-of-a-run or a runsum.
E.g. 4 + 5 + 6 = 15
These are just the difference of two triangular numbers since we have, in our example, 1 + 2 + 3 + 4 + 5 + 6 – (1 + 2 + 3) = T(6) – T(3) = 21 – 6 = 15 but they can be arranged into
a trapezium shape (a quadrilateral with two opposite sides parallel and two opposite sides not parallel):
There is much more about these on Introductory page and this
follow-on page at this site.
Other polygonal numbers and runsums
Not all square numbers are expressible as a the sum of a run of consecutive whole numbers.
The squares of the powers of 2 are not since they are clearly powers of two and no power of two is a runsum.
But the odd squares (2n+1)2are a sum of 2n+1
consecutive integers with 2n+1 as the central number:
We see that p5(r) always has a runsum of length r
being the sum of the r numbers starting at r itself.
The hexagonal numbers are also the odd-ranked triangular numbers and we know the triangular numbers have simple runsums.
p6(r) = r(4r–2)/2 = 1 + 2 + ... + (2r–1)
So the sum of the first 2r–1 numbers is the hexagonal number
p6(r) of rank r.
And the heptagonal (7-sided) numbers also have interesting representations as runsums:
p7(1) = 1
p7(2) = 7 = 3 + 4
p7(3) = 18 = 5 + 6 + 7
p7(4) = 34 = 7 + 8 + 9 + 10
p7(r) = r(5r–3)/2 = (2r–1) + (2r) + (2r+1) + ... + (2r + r–2)
p7(r) is the sum of r numbers starting from
the r-th odd number 2r–1
The octagonal numbersp8(r) = r(3r–2): 1, 8, 21, 40, 65, ...
may not seem to have any obvious runsum connections.
The lack of results here is due to the fact that some octagonal numbers have just one expression as a runsum:
The Calculator above will help with the following investigations:...
You Do The Maths...
Square numbers:
Which square numbers have a runsum of the form runsum(a,a+2) = a+(a+1)+(a+2) and why?
(3n)2 = (3n–1) + (3n) + (3n+1)
Which square numbers have a runsum of length 4? Explain your result.
None do!
If we divide the square numbers by 4
and look at the remainders, we only ever have remainders of 0 or 1:
n
0
1
2
3
4
5
...
2n
2n+1
n2
0
1
4
9
16
25
...
4n2
4n2+4n+1
n2 mod 4
0
1
0
1
0
1
...
0
1
But the sum of 4
consecutive integers is a + (a+1) + (a+2) + (a+3) = 4a+6
which when we divide by 4
has a remainder of 2,
so such runsums are never square.
Show that (5n)2 always has a runsum of length 5
(5n)2 = runsum( 5n2–2, 5n2+2 )
Generalise the above results for square numbers with runsums of lengths 3 and 5.
((2k+1)n)2 = runsum( (2k+1)n2–k, (2k+1)n2+k )
The square of any multiple of an odd number has a runsum with that odd number as its length.
Find a formula for the all the square numbers that have a runsum of length 9.
(3n)2 = runsum( n2–4, n2+4 )
Prove that (4n + 2)2 is always the sum of 8 consecutive numbers
(4n + 2)2 = 16n2 + 16n + 4 = runsum( 8n–7, 8n )
Pentagonal Numbers:
Looking at the pentagonal image above
prove that p5(r) always has a runsum of length r
starting at r itself.
p5(r) = r(3r – 1)/2 = runsum( r, r+(r–1) )
Apart from p5(4) which other
pentagonal numbers have a runsum of length 4?
There are two series:
p5(8n–4) = 96n2 – 100n + 26 = runsum( 24n2–25n+5, 24n2–25n+8 )
p5(8n–1) = 96n2 – 28n + 2 = runsum( 24n2–7n–1, 24n2–7n+2 )
Which pentagonal numbers have a runsum of length 5?
Which pentagonal numbers have a runsum of length 6?
Can you generalise this?
Find a pattern in the runsums for pentagonal numbers of rank 5,9,13,17,21,... 4r+1,....
p5(4n + 1) = runsum( r+1, 7r+1 )
Hexagonal Numbers:
Find a pattern for a runsum for hexagonal numbers of ranks 3, 5, 7, 9, ..., 2r+1, ...
p6(2r – 1) = runsum(3r–2, 5r–4)
Heptagonal Numbers (7-gonal) of the form p7(r) numbers
Do all heptagonal numbers p7(3r) with r≥2
have a runsum of length 9?
Odd polygons:
Look at the runsums of length r that we found
for pn(r) for the odd polygons
n = 3, 5, 7, 9. Extend this to all odd n and find the formula.
For which polygons n
is it true that if r is prime then
pn(r) has a runsum of length r?
All oblong numbers have an even side and an odd side. Show that all oblong numbers
are expressible as a runsum whose length is the odd side of the oblong:
2×3
= 6
= runsum(1,3)
length 3
3×4
= 12
= runsum(3,5)
length 3
4×5
= 20
= runsum(2,6)
length 5
5×6
= 30
= runsum(4,8)
length 5
6×7
= 42
= runsum(3,9)
length 7
7×8
= 56
= runsum(5,11)
length 7
8×9
= 72
= runsum(4,12)
length 9
9×10
= 90
= runsum(6,14)
length 9
runsum(a–k,a+k) is a sum of a run of length 2k+1
runsum(a–k,a+k) = (2k+1) a
[Harder] The oblong number 6 is also a runsum starting at 1,
as is the oblong number 210:
2×3
= 6
= 1 + 2 + 3
14×15
= 210
= 1 + 2 + ... 19 + 20
Are there other solutions to a×(a+1) = 1 + 2 + ... + b?
The values of b are the values of x in these triangles
What is the recurrence relation that applies to the sequences of values of a,
the series of values of a+1 and the sequence of values of
b?
s(n) = 6 s(n-1) – s(n-2) + 2 with different initial terms:
s(0)=0, s(1)=3 gives the series of values of a
s(0)=1, s(2)=3 gives the series of values of a+1
s(0)=0, s(1)=2 gives the series of values of b
The General or Second Polygonal Numbers
There is another series closely associated with the Polygonal numbers of a given order
called the General(ised) Polygonal Numbers. They are the Polygonal numbers of a given order
together with the number of internal points for each (the Second Polygonal numbers).
Let's look at some examples:
The outer edge counts are 0, 6, 12, 18, 24, ... 6(n-1) so that the
internal counts = #dots − #outer are 0, 0, 3, 10, 21, ..., n(2n-1),n≤0=n(2n+1)
and combining these with the (ordinary) hexagonal numbers gives the
Generalized (Second) Hexagonal Numbers: 0,1,3,6,10,15,21,28,... which are just the Triangular numbers n(n+1)/2.
General Heptagonal Numbers
However for the heptagonal (7-sided polygonal) numbers:
For these, the number of internal points is the same as an earlier smaller polygonal number of the same shape.
The second and general triangular and square nunmbers are therefore just the
ordinary triangular and square numbers.
A General Formula
The second n-gonal numbers are given by the formula for the ordinary n-gonal numbers but with negative rank r.
The general n-gonal numbers are by the ordinary n-gonal numbers formula but allowing
the rank r to be both negative and positive.
Polygonal Number Facts
All even Perfect Numbers are hexagonal
A Perfect number is one which is the sum of all of the divisors smaller than itself:
6 has divisors 1, 2, 3 and 6 and 1 + 2 + 3 = 6
28 has divisors 1, 2, 4, 7, 14 and 28 and 1 + 2 + 4 + 7 + 14 = 28
The perfect numbers are 6, 28, 496, ... A000396.
All the even Perfect Numbers are Hexagonal!
Euclid (book IX Proposition 36)
proved that all even perfect numbers must be of the form
2p–1(2p–1)
provided that 2p–1 was a prime number.
Such primes are called Mersenne Primes (for a general value of p they are called the Mersenne numbers) :
3, 7, 31, 127, 2047, ... A001348
For 2p–1 to be prime then p must be a prime number.
It is not known if there are any odd perfect numbers.
p6(r) = r ( 2r – 1).
If we let
r = 2p then we see all even Perfect numbers are hexagonal.
The infinite product (1-x)(1-x2)(1-x3)... and the Pentagonal Numbers
Euler proved that the infinite product of all the terms (1 − xn) with n going from 1 upwards,
when expanded, gives only certain powers of x. The expansion begins:
There are three remarkable facts about this infinite series of powers of x:
All the coefficients are 1 or -1
The powers include all the pentagonal numbers 1, 5, 12, 22, 35, ..., n(3n−1)/2 = p5(n)
The other numbers: 2, 7, 15, 26, 40, ..., n(3n+1)/2.
This is just the pentagonal numbers but for negative n because:
(−n)(3 (−n) − 1)/2 = n(3n+1)/2
These are the General Pentagonal Numbers that we met above.
So we can express the infinite product purely in terms of pentagonal numbers:
∞
(1 −xn) =
∞
(−1)kxp5(k)
Π
Σ
n = 1
k = −∞
When k = 0, p5(0) = 0
so xp5(0) = 1 and (−1)0 = 1 also.
This gives the initial 1 in the expansion.
The capital pi symbol Π means we multiply all the terms (pi is the Greek letter "p" for product) for whole numbers n from 1 up to n=∞
and the capital sigma symbol Σ means we sum all the terms (sigma is the Greek letter "s" for sum) for all whole numbers k both positive an negative
(from −∞ up to ∞).
Another Infinite product and the Triangle Numbers
If we multiply the infinite product (1+x)(1+x2)(1+x3)... above
by the infinite product (1–x2)(1–x4)(1–x6)...
the result is another polynomial with coefficients ±1 and whose powers of x are just
the Triangle numbers:
There is also an expression for the infinite polynomial with triangle number coefficients:
x
= x + 3x2 + 6x3 + 10x4 + ...
( 1 − x )3
This is called the generating function for the triangle numbers. The coefficient of xn is
T(n), the n-th triangle number.
The equation is true numerically only when x is between −1 and 1.
For instance put x=2 in this equation and the
left-hand side is 2 / (−1)3 = −2, which
is negative whereas the right-hand side is a sum of purely positive terms and must be positive.
But provided the size of x is less than 1 (−1 < x < 1) then it is
true numerically also.
So let's see what happens if we put in a valid number for x: let x = 1/100.
We can then multiply top and bottom of the left-hand side by
1003 to get a decimal fraction from the triangle numbers:
We have found a decimal value made up of the triangle numbers written in order and also shown it is an exact fraction.
Since we take the triangle numbers with just 2 decimal places each, they soon start to overflow and eventually the
triangle numbers are not so easily seen. In fact, the pattern will eventually repeat in a periodic fashion and
we see this same initial pattern reappear!
This is explained with much more on my
Fractions and Decimals page.
Here is a table of generating functions for the other polygonal numbers
Triangle
x
= x + 3x2 + 6x3+...
(1−x)3
Square
x(1 + x)
= x + 4x2 + 9x3+...
(1−x)3
Pentagonal
x(1 + 2x)
= x + 5x2 + 12x3+...
(1−x)3
Hexagonal
x(1 + 3x)
= x + 6x2 + 15x3+...
(1−x)3
k-gonal
x(1 + kx)
= pk(1)x + pk(2)x2 + ...
(1−x)3
You Do The Maths...
The generating function for the square numbers is
x ( 1 + x )
= x + 4x2 + 9x3 + 16x4 + ...
( 1 – x )3
What proper fraction has as its decimal expansion the number 0.01 04 09 16 25 36 ...?
What proper fraction would give 0.001 004 009 016 025 036 ...?
This time the overflow occurs much later in the decimal expansion when the squares reach 4 digits in length:
302 = 900, 312=961 but 332 = 1024 so will "overflow" to the affect the
square before:
1001000 / 997002999 =
0.001 004 009 016 025 036 049 064 081 100
121 144 169 196 225 256 289 324 361 400
441 484 529 576 625 676 729 784 841 900
9620250901...
Use the Pentagonal Numbers generating function from the table above:
What proper fraction has as its decimal expansion the number 0.01 05 12 22 35 ...?
What proper fraction would give 0.001 005 012 022 035 ...?
Take the pattern back to the one before the triangular numbers. What fraction for x do you get? What is the series
of coefficients of this fraction ?
Recreations in the Theory of Numbers by A H Beiler, Dover, 1964
was the first book that opened my eyes to the wonderful fun and facts about simple numbers.
Chapter XVIII is on Ball Games and contains interesting maths on Polygonal, Pyramidal and Figurate numbers.
This book has been in print now for many years and is a real classic,
being both readable and full of interesting facts and tables and
certainly accessible to anyone with an interest in "recreational" mathematics and numbers.
Highly recommended!
The sub-title of the book is The Queen of Mathematics Entertains, a quote from Gauss:
Mathematics is the queen of the sciences and arithmetic the queen of mathematics.
Figurate Numbers
E Deza, M M Deza (World Scientific 2012)
This must surely become the "bible" on Figurate Numbers. It is encyclopaedic in its details, breadth and wealth of information on all
aspects of Figurate Numbers, full of formula and, as we do here, points to the OEIS series. It not only details results on 2D polygonal
numbers but also 3D and multi-dimensional and also plain and centered polygonals. Highly recommended for the specialist as it is
quite expensive. Otherwise go to your local (university) library and look at it for free!
The Book of Numbers
by John H Conway and Richard K Guy, (1995)
An excellent and interesting book to dip into and you soon will be investigating for yourself the
many and varied topics covered here. Chapter 2
Figures from Figures: Doing Arithmetic and Algebra by Geometry
in particular covers the material on this page and more.
History of the Theory of Numbers:
Vol II Diophantine Analysis by L E Dickson
is a classic and monumental reference work on all aspects of the History and development
of Number Theory, in 3 volumes (Vol 1 Divisibility and Primality and
volume III on Quadratic and Higher Forms).
Although the original edition was 1952 and nothing since then is covered in the book,
it is still a comprehensive summary of useful
historical survey of references to the famous and not-so-famous mathematicians who have developed
the area of mathematics we now call Number Theory.
The link above is to a new cheap Dover paperback edition (2005) of Volume II where chapter 1 is
Polygonal, Pyramidal and Figurate Numbers, and much of the rest of this encyclopedic work is
about the history of expressing a number as a sum of squares, 3D and higher dimensional figures
and many related problems that we have only begun to introduce to you on this page.
A Short Proof of Cauchy's Polygonal Number Theorem by M B Nathanson
is in Proceedings of the American Mathematical Society,
Vol. 99, No. 1, January 1987, pages 22-24 and is available
in JSTOR
Disquisitiones Arithmeticae by Carl Friedrich Gauss
(1801) translated by A A Clarke into English (1965), in paperback form,
is a rich source of much material on congruent numbers, modular arithmetic and the first proof
of Fermat's (Polygonal Number) Theorem in article
293 on page 342.
Triangular Stitching D Eperson, Math Gaz 54 (1970), page 50 Curve stitching between two straight lines
means a triangular number of points of intersection and of regions too.