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.
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:
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
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?
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 r^{th} 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
Notation
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:
p_{n}(r)
means the polygonal number with n sides and the outer side (its rank)
having
r dots. T(r) means the same as p_{3}(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 p_{3}(r) to mean the
r^{th} 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
r^{2} dots.
Everyday Examples of Square Numbers
Square arrangements are around us everywhere, from flags on the pavement (sidewalk) to blocks of buildings in New York.
But it is not so easy to find exact squares of dots. Here are some:
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
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 =
=
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
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^{ }
n^{2}
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 n^{2} + 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:
3^{2} + 4^{2}
=
5^{2}
10^{2} + 11^{2} + 12^{2}
=
13^{2} + 14^{2}
21^{2} + 22^{2} + 23^{2} + 24^{2}
=
25^{2} + 26^{2} + 27^{2}
36^{2} + 37^{2} + 38^{2} + 39^{2} + 40^{2}
=
41^{2} + 42^{2} + 43^{2} + 44^{2}
...
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 = 2^{2} × 3^{1} and it has 2 shapes of rectangle as do 18 = 2^{1} × 3^{2} and 20 = 2^{2} × 5^{1} and 63 = 3^{2} × 7^{1} whereas 24 = 2^{3} × 3^{1} has 3 different shapes and so does 30 = 2^{1} × 3^{1} × 5^{1} but 72 = 2^{3} × 3^{2} has 5.
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, 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][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?
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
edges.
Can you find the hexagonal numbers in this number pattern?
6^{2} + 7^{2}
=
9^{2} + 2^{2}
15^{2} + 16^{2} + 17^{2}
=
19^{2} + 20^{2} + 3^{2}
28^{2} + 29^{2} + 30^{2} + 31^{2}
=
33^{2} + 34^{2} + 34^{2} + 4^{2}
...
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
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 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 p_{3}(r)?
The triangle with side r
is just the triangle with side r
–1 with an extra row of r dots: p_{3}(r) = p_{3}(r–1) + r
We start with p_{3}(1) = 1, so we can use the recursive formula to find
p_{3}(r) for any r now.
We can find a formula :
If we take two copies of the r^{th} 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 p_{3}(3) triangles of size 6 make a rectangle of
6 + 6 = 3 × 4 and
the two p_{3}(4) triangles of size 10
make a rectangle of 10 + 10 = 4 × 5
and so on.
We can do this with any p_{3}(r) to get a rectangle of
r (r+1) dots.
Since this is made up of
two copies of p_{3}(r), then we have our formula:
p_{3}(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 p_{5}(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: p_{5}(r) = r + 3 (r–1)r/2
Simplifying this we have:
p_{5}(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:
p_{6}(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 p_{n}(r):
The Polygonal Numbers p_{n}(r)
_{↓n}^{r→}
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 2, for
r=3 it is 3 and for rank r the items always differ by r.
So p_{n}(r) = p_{n-1}(r) + r and p_{2}(r) = r.
From here it is quite easy to find a formula for p_{n}(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):
p_{3}(r) = p_{3}(r-1) + r and p_{3}(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:
p_{4}(r) = p_{4}(r-1) + 2r – 1 and p_{4}(1) = 1
But this is just our old friend from algebra:
r^{2} = (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:
p_{5}(r) = p_{5}(r-1) + 3r – 2 and p_{5}(1) = 1
We can continue with the other rows by spotting a pattern in these differences.
This is an effective method for computing p_{n}(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 p_{n}(r)
A direct formula means we plug in the values of n and r and can directly compute p_{n}(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 p_{n}(r), there is a simple formula and it is simple to prove too.
Can you now find a formula for a general polygonal number p_{n}(r)?
A hint for one method is in the colourings of these rank 6 polygons:
p_{6}(6)
p_{7}(6)
p_{8}(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. p_{n}(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 .
p_{n}(r) = r + ( n–2 )
( r–1 ) r
2
Here is a table and another way of deriving alternative forms for p_{n}(r) by generalizing
patterns across the rows or down the columns:
We now have these formulae for the Polygonal number p_{n}(r)
of n sides and size r (that is the number
of dots on each of the n outer sides):
p_{n}(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 (r + 1)
+ (n – 3)
r (r – 1)
2
2
(E)
=
(n – 2) r^{2} – (n – 4) r
2
(F)
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 p_{n}(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 p_{n}(r) from n
times a triangular number.
(D) was derived in the section A formula for p_{n}(r) just before the table above
where we saw that p_{n}(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:
p_{n}(r) =
p_{n–1}(r) + r(r – 1)/2 if n>2
(R1)
p_{2}(r) =
r_{ }
p_{n}(r) =
2 p_{n}(r – 1) – p_{n}(r – 2) + n – 2 if r>1,
(R2)
p_{n}(0) =
0_{ }
p_{n}(1) =
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 p_{n}(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.
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 K_{n}.
← 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 + n^{2} - n )
n + T(n-1) = ½ (n^{2} + 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 + 0^{1} = 1^{2}
3 + 1^{2} = 2^{2}
5 + 2^{2} = 3^{2}
7 + 3^{2} = 4^{2}
9 + 4^{2} = 5^{2}
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) = 3^{2}
1 + 8 T(2) = 5^{2}
1 + 8 T(3) = 7^{2}
1 + 8 T(4) = 9^{2}
1 + 8 T(5) = 11^{2}
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 K_{n} 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 K_{3} - is it possible?
What about K_{4}? and K_{5}?
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 K_{n} networks and decide if we can or
cannot draw it without taking the pen off the paper?
In K_{n}, 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
K_{n} 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:
Let's use the shorthand notation T(r) for the r^{th} Triangle number:
T(r) = p_{3}(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 = 3^{2}
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 = 30^{2}
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 formulae 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!
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 m^{2}. For instance,
1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 = 36 = 6^{2}
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 m^{2} 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!
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 a^{2} + b^{2} = h^{2}
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 = p_{4}(99) = p_{5}(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 = p_{k}(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 = p_{n}(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 formulae above for p_{n}(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 (B) above we have:
Given the value of k, to find n and
r such that k = p_{n}(r) using the formula
(B) 2 p_{n}(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=p_{28}(2): correct!
= 4 × 14 Let r=4, then
14 = (4-1)n - 8 + 4 = 3n-4 which means n
must be 6 and k=p_{6}(4): correct!
= 7 × 8 Let r=7 then
8 = (7-1)n - 14 + 4 = 6n-10 which means n
must be 3 and k=p_{3}(7): correct!
28 is polygonal in three ways
p_{28}(2)
p_{6}(4)
p_{3}(7)
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 p_{n}(r) formulae
above and rearrange it to find r given n
and the number p_{n}(r).
p_{n}(r) =
r( (n–2)r – n + 4 )
2
we are given p (let's use this to stand for p_{n}(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) r^{2} – r (n – 4 ) ⇒
(n – 2) r^{2} – 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.
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
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 3 Triangular Numbers Representation Calculator
First, make a list of the Triangular numbers up to 100
either
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:
A000217
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 : p_{3}(2) + p_{3}(2) = p_{3}(3)
If we want to insist on two different numbers, then we have
6 + 15 = 21 : p_{3}(3) + p_{3}(5) = p_{3}(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 : p_{4}(3) + p_{4}(4) = p_{4}(5)
For the other polygonal numbers, a little searching reveals the following:
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 p_{3}(2) is triangular : 2 p_{3}(2) = p_{3}(3) : 3 + 3 = 6 and also 2 p_{5}(5) = p_{5}(7) : 35 + 35 = 70 .
There are no solutions to 2 p_{4}(r) = p_{4}(s) : 2 r^{2} = s^{2}
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 p_{n}(r) = p_{n}(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 a^{2} × b^{2} = (ab)^{2}
but are there other shapes too where
p_{n}(a) × p_{n}(b) = p_{n}(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
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.
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: p_{3}(r)^{2}
which begins 1, 3^{2}=9, 6^{2}=36, 10^{2}=100, ...
What do you notice about the difference between one and the next?
Can you now write down a formula for
1^{3} + 2^{3} + 3^{3} +
... + n^{3} ?
If you add two neighbours in the list, what do you notice (hint: look in the list of
triangular numbers)?
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?
Harder:
The list of numbers that need 4 squares is infinitely long. Use the Polygonal Sums Calculator
to find some by using
whose smallest list 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?
Is it true that there are pentagonal numbers that are the sum of two different pentagonal numbers?
Matchstick Numbers
Instead of using dots let's use matchsticks instead to make patterns.
Matchstick Squares
Here, for instance, are the Matchstick square numbers:
size
1
2
3
4
Square
number
4
12
24
40
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 square of side n?
Surprisingly, these numbers are the octagonal numbers with negative size! The number of
matchsticks in a square of side r is p_{8}(–r).
You can also investigate what happens to p_{n}(–r) for the other
polygons with negative rank. Can we give an interpretation to these numbers in terms of diagrams?
Matchstick Triangles
Let's see what we get if we form equilateral triangles with the matchsticks:
size
1
2
3
4
Triangle
number
3
9
18
30
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
side n?
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 n^{th} is the smallest number
that is a sum of both n-1 and of n consecutive numbers:
9
= 2 + 3 + 4
= 4 + 5
18
= 3 + 4 + 5 + 6
= 5 + 6 + 7
30
= 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:
tiers
1
2
3
4
House of Cards
Nb of cards
2
7
15
26
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 n^{th} is the sum of the next n numbers after n:
1^{st}
2
= 2
2^{nd}
7
= 3 + 4
3^{rd}
15
= 4 + 5 + 6
4^{th}
26
= 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 n^{th} 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
Matchstick Hexagons
We can extend our matchstick triangle patterns to hexagons:
size
1
2
3
4
Hexagon
number
12
42
90
156
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
side n?
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)^{2}are a sum of 2n+1
consecutive integers with 2n+1 as the central number:
We see that p_{5}(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.
p_{6}(r) = r(4r–2)/2 = 1 + 2 + ... + (2r–1)
So the sum of the first 2r–1 numbers is the hexagonal number
p_{6}(r) of rank r.
And the heptagonal (7-sided) numbers also have interesting representations as runsums:
p_{7}(1) = 1
p_{7}(2) = 7 = 3 + 4
p_{7}(3) = 18 = 5 + 6 + 7
p_{7}(4) = 34 = 7 + 8 + 9 + 10
p_{7}(r) = r(5r–3)/2 = (2r–1) + (2r) + (2r+1) + ... + (2r + r–2)
p_{7}(r) is the sum of r numbers starting from
the r-th odd number 2r–1
The octagonal numbersp_{8}(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
n^{2}
0
1
4
9
16
25
...
4n^{2}
4n^{2}+4n+1
n^{2} 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( 5n^{2}–2, 5n^{2}+2 )
Generalise the above results for square numbers with runsums of lengths 3 and 5.
((2k+1)n)^{2} = runsum( (2k+1)n^{2}–k, (2k+1)n^{2}+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( n^{2}–4, n^{2}+4 )
Prove that (4n + 2)^{2} is always the sum of 8 consecutive numbers
Find a pattern in the runsums for p_{8}(4r) if r>2.
Odd polygons:
Look at the runsums of length r that we found
for p_{n}(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
p_{n}(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
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:
Centred Triangles
Rank
1
2
3
4
5
Shapes
Counts
1
4
10
19
31
Centred Squares
Rank
1
2
3
4
5
Shapes
Counts
1
5
13
25
41
Centred Pentagons
Rank
1
2
3
4
5
Shapes
Counts
1
6
16
31
51
Centred Hexagons
Rank
1
2
3
4
5
Shapes
Counts
1
7
19
37
61
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 C_{3}(r),
Centred Square Numbers C_{4}(r)
and Centred Pentagonal Numbers C_{5}(r).
Find a formula for the Centred n-gonal numbers C_{n}(r)
Can you find the formula for C_{n}(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:
1
1+3+1
1+3+5+3+1
1+3+5+7+5+3+1
Express this pattern using polygonal numbers:
2^{2} + 1^{2}
3^{2} + 2^{2}
4^{2} + 3^{2}
5^{2} + 4^{2}
Here is an alternative pattern for the even-shaped centred polygonal numbers. Can you use it
express C_{2n}(r) algebraically?
But these numbers are also the Centred 12-gonal numbers:
Each 12-gon
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
p_{b}(r) and the centred polygonal numbers
p_{b}(r).
Integer Representations
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:
p_{n}(r) = r + (n – 2)
r(r–1)
2
p_{4}(6) = 2 T(5) + 6
p_{5}(6) = 3 T(5) + 6
p_{6}(6) = 4 T(5) + 6
p_{7}(6) = 5 T(5) + 6
p_{8}(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:
c_{n}(r) = 1 + n
r(r–1)
2
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:
c_{3}(6) = 3 T(5) + 1
c_{4}(6) = 4 T(5) + 1
c_{5}(6) = 5 T(5) + 1
c_{6}(6) = 6 T(5) + 1
c_{7}(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
2^{p–1}(2^{p}–1)
provided that 2^{p}–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 2^{p}–1 to be prime then p must be a prime number.
It is not known if there are any odd perfect numbers.
p_{6}(r) = r ( 2r – 1).
If we let
r = 2^{p} then we see all even Perfect numbers are hexagonal.
If we multiply the infinite product (1+x)(1+x^{2})(1+x^{3})...
by the infinite product (1–x^{2})(1–x^{4})(1–x^{6})...
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
= x + 3x^{2} + 6x^{3} + 10x^{4} + ...
( 1 − x )^{3}
This is called the generating function for the triangle numbers. The coefficient of x^{n} 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
100^{3} 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 + 4x^{2} + 9x^{3} + 16x^{4} + ...
( 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 + 5x^{2} + 12x^{3} + 22x^{4} + ...
( 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 + 6x^{2} + 15x^{3} + 28x^{4} + ...
( 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
Polygonal Numbers.
Here are three views of a stack of 5 squares making a Square-based Pyramid:
Square based Pyramid of 5 layers
Side view
Expanded view of layers
Top view
and here is a Pentagonal-based Pyramid of height 5:
The layers are just the pentagonal numbers we saw earlier:
side
1
2
3
4
5
shape
size
1
5
12
22
35
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 P_{n}(r)
using a capital P for our 3D shapes and the small p
is used p_{n}(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:
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 P_{n}(r) form.
4=P_{3}(2)
5=P_{4}(2)
6=P_{5}(2)
14=P_{4}(3)
20=P_{3}(4)
More dimensions and Pascal's Triangle
The Triangular shapes of 2D and 3D are part of a more general pattern:
r:
1
2
3
4
5
6
p_{3}(r):
1
3
6
10
15
21
P_{3}(r):
1
4
10
20
35
56
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:
Dimension
r=1
r=2
r=3
r=4
r=5
r=6
0:
1
1
1
1
1
1
1:
1
2
3
4
5
6
2: p_{3}(r)
1
3
6
10
15
21
3:P_{3}(r)
1
4
10
20
35
56
4:
1
5
20
30
65
121
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:
1
1
1
1
2
1
1
3
3
1
1
4
6
4
1
1
5
10
10
5
1
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
A002412
Find a formula for the Pyramid Number P_{n}(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.
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.
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.