Numbers as an arrangement of dots can be made into various shapes such as triangle shapes, or squares,
or pentagons, hexagons and so on.
Such polygons are flat and two-dimensional but we can extend the idea to three and even to
higher dimensions to get Figurate Numbers. They have been an object of interest for mathematicians since the
days of Pythagoras and the Ancient Greeks and still provide an excellent vehicle for "proofs without words" and for
spotting number patterns as well as for practicing proving your ideas using algebra.
(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:
1 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
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.
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-
(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?
The Polygonal Numbers
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.
The Triangle Numbers
We start with a triangle with a single dot,
then one with two dots on each side, giving a shape with 3 dots,
then 3 dots on a side with a total of 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
If we have a single line of cars waiting at traffic lights and any number of the cars may go through each time the lights are GO
but the cars only go through in the original order.
How many different sequences of cars are there that can go through the lights each time the lights are GO?
For instance, with 3 cars, ABC we can have: ABC; A, BC; AB, C; and A,B,C but we have already counted the single
sequences with just A and just C, so the possible sequences are ABC; AB; BC; A; B; C
making a total of 6 possible sequences of cars passing through
through the lights. 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?
Why is this the same problem as the number of ways of inserting one pair of brackets
in a sequence on n numbers? For example, for 3 numbers we have:
(123), (12)3, 1(23), (1)23, 1(2)3, 12(3)
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
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:
means the polygonal number with n sides and the outer side (its rank)
r dots. T(r) means the same as p3(r)
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:
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
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
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.
Any non-Rectangular number is a Prime number
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.
The number of ways of writing n as a Rectangular number
The number of ways to express a number n as a product is
the number of divisors of n. 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 as the sides of a Rectangular number.
Thus we have
4 is the smallest Rectangular number and is also square
4 = 2×2;
but 6 is the smallest purely rectangular 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
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):
This simple series has many applications in its own right.
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 shapes and so does 30 = 21 × 31 × 51 but 72 = 23 × 32 has 5.
What is the sum of the reciprocals of the first n oblong numbers?
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, as n→∞, 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] 4, [1 2] 3 ,
[2 3] 4, 1 [2 3],
 2 [3 4], 1 [3 4]
: 6 ways.
What if the strip was of length n=5? n=6? n=7?
Can you justify your answer?
What is the average of two consecutive oblong numbers?
[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?
Everyday examples of Rectangular Numbers
Trapezoidal Numbers or 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.
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.
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
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
Algebra and 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
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 Formulae for Number Pattern Diagrams
Here you can have a go at finding the formulae 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:
r( r+1 )
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?
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:
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
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
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)
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 2, for
r=3 it is 3 and for rank r the items always differ by r.
So pn(r) = pn-1(r) + r and 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.
A formula 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:
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
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 formulae 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):
(n – 2 ) r – n + 4
(r – 1) n – 2r + 4
r (r – 1)
– r (r – 2)
r + (n – 2)
r (r – 1)
r (r + 1)
+ (n – 3)
r (r – 1)
(n – 2) r2 – (n – 4) r
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) derives pn(r) from n
times a triangular number.
(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) tells us that any polygonal number is a (simple) linear combination of triangle numbers
and that these can be consecutive triangle numbers too.
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).
(F) 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–1(r) + r(r – 1)/2 if n>2
2 pn(r – 1) – pn(r – 2) + n – 2 if r>1,
(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
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.
The patterns we have seen above are just "Proofs without words". They demonstrate a mathematical property
true for an infinite collection of shapes. They can also be verified quite easily using algebra and applying
just 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
formulae of the previous section, to provide a proof that your formula will always be 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.
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
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
Summing up the odd numbers
Two triangles plus a line
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
Summing the n numbers starting from n
A square with two triangles on its sides
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.
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
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:
n (n + 1) (n + 2)
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 ∇
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:
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?
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.
T(2) × T(24) =
= 3×12×25 = 302
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 formulae can you find?
T(1) + T(2) + T(3)
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
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
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
It looks as if this formula shouldn't give whole number solutions, but it does!
Two Squares make another
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. Meanwhile, how about.....
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?
When is a number Polygonal?
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
(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 formulae 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,
From formula (B) above we have:
Given the value of k, to find n and
r such that k = pn(r) using the formula
(B) 2 pn(r) = r ( (r–1)n – 2r + 4 )
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
For each of these, take r as the first and then we have the value of the second factor in our formula,
namely (r–1) n – 2r + 4. Substitute the value of r:
2 k = 56
= 2 × 28 Let r=2,
then 28 = (2-1)n - 4 + 4 = n which means n must be
28 and k=p28(2): correct!
= 4 × 14 Let r=4, then
14 = (4-1)n - 8 + 4 = 3n-4 which means n
must be 6 and k=p6(4): correct!
= 7 × 8 Let r=7 then
8 = (7-1)n - 14 + 4 = 6n-10 which means n
must be 3 and k=p3(7): correct!
28 is polygonal in three ways
NOTE that sometimes a factorisation of 2k produces a value of
n that is not an integer, for example when k=12:
2 × 12 = 4 × 6 Let r=4 then
6 = (4-1)n - 8 + 4 = 3n-4 and so n= 10/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) formulae
above and rearrange it to find r given n
and the number pn(r).
r( (n–2)r – n + 4 )
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.
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:
(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:
(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.
The Multi-Polygonal Number Calculator
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
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 here:
Numbers common to two Polygonal Sequences D S Lucas, Fib Q 11 (1973), page 80-84
see pdf version.
Is every number the sum of Polygonal Numbers of one shape?
We have already 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?
Sums of Triangular Numbers
As we go further down the list of triangular numbers, we know their differences
increase by one each time, which makes for an easy way to compute the Triangular Number
series from the beginning:
1 + 2 = 3
3 + 3 = 6
6 + 4 = 10
10 + 5 = 15
This was how the ancient Greeks defined this sequence.
We saw above that we can add two neighbouring Triangular numbers to make a square.
What other 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 to add 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, "EUREKA! (I've found it!) Every number is the sum of 3 triangular numbers".
He had found the first proof.
Of course some numbers are triangular already,
and we know the squares are the sum of two triangular numbers
but Gauss's proof
is that we never need more than 3 of
triangular numbers for their sum to be any number we please.
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
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
The 3 Triangular Numbers Representation Calculator
First, make a list of the Triangular numbers up to 100
using the Triangle Number calculator above
or by hand:
by starting at 1, then adding 2 to get the next
and adding 3 onto that to get the fourth, then add 5, and so on. Check your list here:
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. For instance 5=1+1+3 and 8=1+1+6.
are not the sum of any smaller set of Triangular numbers.
What are the next two numbers that need 3 triangular numbers?
Check your answer here:A020757
Sums of Square Numbers
We need at least four squares to be summed to produce numbers such as
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)
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)
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
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
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.
odd p limit
even p limit
The Polygonal Number Sums Calculator
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
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.
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
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?
Can you now write down a formula for
13 + 23 + 33 +
... + n3 ?
If you add two neighbours in the list, what do you notice (hint: look in the list of
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?
In a Dancing Competition involving
n couples, everyone in the competition is on the floor dancing and
being judged by a panel of judges.
After each dance the judges decide on
one couple to be eliminated from the rest of the competition.
At the end of the event the couple remaining is the winner. How many
separate couples performing a dance do the judges have to grade?
Replace the dancing competition above by a Talent Show in which after each round, one entry is removed.
How many acts are judged by the panel?
Why is the answer to all these a Triangular number?
Surprisingly, these numbers are the octagonal numbers with negative size! The number of
matchsticks in a square of side r is p8(–r).
You can also investigate what happens to pn(–r) for the other
polygons with negative rank. Can we give an interpretation to these numbers in terms of diagrams?
Let's see what we get if we form equilateral triangles with the matchsticks:
Can you find the pattern in this sequence of numbers?
What is the next number?
What is a formula for the number of matchsticks in a triangle of
3, 9, 18, 30, ... A045943
3 n (n+1) / 2 which we see are also just 3 T(n).
These numbers also have a special overlapping runsum property:
the nth is the smallest number
that is a sum of both n-1 and of n consecutive numbers:
= 2 + 3 + 4
= 4 + 5
= 3 + 4 + 5 + 6
= 5 + 6 + 7
= 4 + 5 + 6 + 7 + 8
= 6 + 7 + 8 + 9
House of Cards
Once we have the formula for Matchstick Triangles, it is easy to find the formula for
a House of Cards:
House of Cards
Nb of cards
What is the next number?
What is a formula for the number of cards in a House of Cards of
n tiers (n levels high)?
3, 9, 18, 30, ... A045943
are the Matchstick Triangle numbers
3 n (n+1) / 2
but we take 1 from the first, 2 from the second, ... n from the n-th, ... to get
the series 3-1=2, 9-2=7, 18-3=15, 30-4=26, 40, 57,... A005449
with formula 3 n (n+1) / 2 – n = n (3n+1)/2
These numbers also have a runsum property: The nth is the sum of the next n numbers after n:
= 3 + 4
= 4 + 5 + 6
= 5 + 6 + 7 + 8
Can you also write each of these House of Cards numbers as a pronic number + a triangle number?
Take n from the nth House of Cards number. You should find a series that we have met before - but which is it?
n(3n+1)/2 = n(n+1) + n(n–1)/2
2-1=1, 7-2=5, 15-3=12, 26-4=22, ... and 1,5,12,22,...
are the Pentagonal Numbers
We can extend our matchstick triangle patterns to hexagons:
Can you find the pattern in this sequence of numbers?
What is the next number?
What is a formula for the number of matchsticks in a hexagon of
T(r) is the sum of the first r numbers beginning at 1.
Not all square numbers are expressible as a runsum, that is as the sum of a run of consecutive 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 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
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
Centred Polygonal Shapes
Up to now, our shapes have grown outward from one corner. We have found many useful series and patterns that are used extensively
throughout mathematics. But we can also make polygonal shapes that grow
from the centre by adding a new layer all around the outside.
Here is a table:
You Do The Maths...
Find the next number in each of the series in the tables above by looking at what we add to one
number to get the next. Can you see why this is so from the diagrams?
Find a formula for the Centred Triangle Numbers C3(r),
Centred Square Numbers C4(r)
and Centred Pentagonal Numbers C5(r).
Find a formula for the Centred n-gonal numbers Cn(r)
Can you find the formula for Cn(r) in terms of
Triangle numbers T(n-1) from this pattern which uses shapes of side 6?
Which polygonal shape corresponds to the following series of sums of odd numbers:
Express this pattern using polygonal numbers:
22 + 12
32 + 22
42 + 32
52 + 42
Here is an alternative pattern for the even-shaped centred polygonal numbers. Can you use it
express C2n(r) algebraically?
But these numbers are also the Centred 12-gonal numbers:
is made up of 12 triangles plus an extra dot and can therefore be
can be transformed into the corresponding star shape: for example...
Centred Polygonal Numbers versus Corner Polygonal Numbers
There are several important differences between the ordinary or corner polygonal numbers
pb(r) and the centred polygonal numbers
Fermat's theorem above shows that we can represent any integer as a sum of polygonal numbers in many ways,
as a sum of 3 triangular numbers or a sum of up to 4 square numbers, or 5 pentagonal etc. This is not true for
centred polygonal numbers as the numbers are too far apart.
For instance, with centred triangular numbers:
1, 4, 10, 19, 31, 46, ...
7 needs at least 4 centred triangle numbers: 7 = 4 + 1 + 1 + 1, and
17 needs at least 5 centred triangle numbers: 17 = 10 + 4 + 1 + 1 + 1.
For centred square numbers:
1, 5, 13, 25, 41, 61
9 needs at least 5 centred square numbers: 9 = 5 + 1 + 1 + 1 + 1, and
22 needs at least 6 centred square numbers: 22 = 13 + 5 + 1 + 1 + 1 + 1.
As sums of triangular numbers
The cornered n-gonal polygonal numbers are made up of n-2 (cornered) triangular numbers of rank
r-1 plus (a line of) r:
pn(r) = r + (n – 2)
p4(6) = 2 T(5) + 6
p5(6) = 3 T(5) + 6
p6(6) = 4 T(5) + 6
p7(6) = 5 T(5) + 6
p8(6) = 6 T(5) + 6
whereas a centred n-gonal polygon is made up of n (cornered) triangular numbers of rank
r-1 plus an extra 1:
cn(r) = 1 + n
which is an easy way to remember their formulae.
The centred polygonal numbers formula is illustrated by these dot-diagrams from the
You Do The Maths... question above:
c3(6) = 3 T(5) + 1
c4(6) = 4 T(5) + 1
c5(6) = 5 T(5) + 1
c6(6) = 6 T(5) + 1
c7(6) = 7 T(5) + 1
The Plain and Centred Polygonal Number Calculator
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 - Plain and Centred
Numbers common to several shapes
-shaped and centre-shaped in the range
show their ranks too?
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
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.
If we multiply the infinite product (1+x)(1+x2)(1+x3)...
by the infinite product (1–x2)(1–x4)(1–x6)...
the result is a polynomial that is a just a sum of powers of x and those powers are all
the Triangle numbers:
There is also an expression for the infinite polynomial with triangle number coefficients:
= 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 < 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.
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 ...?
For the Pentagonal Numbers we have
x ( 1 + 2 x )
= x + 5x2 + 12x3 + 22x4 + ...
( 1 – x )3
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 ...?
For the hexagonal numbers, the generating function is
x ( 1 + 3 x )
= x + 6x2 + 15x3 + 28x4 + ...
( 1 – x )3
Looking at all the generating functions above, guess the Generating Function for the n-gonal numbers.
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 ?
Pyramids: Number Shapes as Solids in 3 dimensions
Let's move into three dimensions and to start off, look at Pyramid Numbers since these are related to the
Here are three views of a stack of 5 squares making a Square-based Pyramid:
Square based Pyramid of 5 layers
Expanded view of layers
and here is a Pentagonal-based Pyramid of height 5:
The layers are just the pentagonal numbers we saw earlier:
You can see that each layer is one of our polygonal images, and a Pyramid of r layers has one each of
the polygonal numbers with rank from 1 to r. We will denote these as Pn(r)
using a capital P for our 3D shapes and the small p
is used pn(r) for the 2D polygonal numbers
we looked at earlier.
Since we stack r layers to make a pyramid of height (or rank)
r, we have the definition:
Pn(r) = pn(1) + pn(2) + ... + pn(r-1) + pn(r)
For the Polygonal numbers, we summed arithmetic series, accumulating sums from the beginning,
1, 2, 3, 4, 5, ... to get the series 1, 3, 6, 10, 15, ... The Triangular numbers 1, 3, 4, 7, 9, ... to get the series 1, 4, 9, 16, 25, ... The Square numbers 1, 4, 7, 10, 13, ... to get the series 1, 5, 12, 22, 35, ... The Pentagonal numbers
and so on
If we now do the same thing but sum the polygonal number series, we get the Pyramid Numbers.
If we stack Triangles on top of each other, we make a pyramid which has a Triangle on each layer, and so on.
1, 3, 6, 10, 15, ... to get the series 1, 4, 10, 20, 35, ... The Triangular Pyramid numbers 1, 4, 9, 16, 25, ... to get the series 1, 5, 14, 30, 55, ... The Square Pyramid numbers 1, 5, 12, 22, 35, ... to get the series 1, 6, 18, 40, 75, ... The Pentagonal Pyramid numbers
and so on
Here are some simple examples of Pyramid Numbers. How many objects in each picture?
Write each in Pn(r) form.
More dimensions and Pascal's Triangle
The Triangular shapes of 2D and 3D are part of a more general pattern:
We could even invent a 2D version since each row is formed by summing the items on the previous row from the beginning up to
that column, and continue with a Fourth Dimension and Fifth too, although it would be difficult to see how we
could represent these in a (2D) diagram:
If we look at the upwards diagonals in this table starting each in the leftmost column you might find that this new
triangle of numbers is one you have met before:
You Do The Maths...
You are working in a greengrocers shop and have just arranged the new batch of oranges
into in a polygonal pyramid of 3 layers. The shopowner says he now wants them
rearranging into a square-based pyramid.
You manage to arrange them all as he requires with none left over. How many oranges could you have had?
What was the polygon shape that you used in your original pile?
Why is it much easier to arrange round fruit in layers which are Hexagonal polygon numbers?
Make a list of all the Hexagonal Pyramid Numbers up to 100.
Check your answer with
Find a formula for the Pyramid Number Pn(r).
References and Further Reading
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.
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.
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
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.