This page investigates numbers that are the sum of a run of whole numbers, such as 5+6+7 or
2+3+4+5+6, their properties and fascinating patterns.
Please note that this page now includes single numbers as runsums (they were
excluded in versions of this page before Jan 2003). This makes formulae on later pages
The icon means there is a
Things to do section of questions to start your own investigations.
The calculator icon
indicates that there is a live interactive calculator in that section.
Contents of this page
Sums of Runs
A run of numbers is a sequence of
consecutive whole numbers i.e. with no gaps in the sequence,
Every number is therefore a sum of numbers in a run because we can have a run with just a single number in it!
| such as || 2, 3, 4; |
| and || 7 || is a run even though it contains just a single number|
| but not|| 5, 6, 8, 9 ||because 7 is missing |
| and not|| 2, 3, 3 || because 3 is repeated|
Many numbers can also be written as a sum of a run of 2 or more numbers. For example:
For convenience, the sum of a run of numbers we will call a runsum.
| 9 = 2 + 3 + 4 = 4 + 5|
| 10 = 1 + 2 + 3 + 4|
| 11 = 5 + 6 |
| 12 = 3 + 4 + 5|
| 13 = 6 + 7|
| 14 = 2 + 3 + 4 + 5|
Making a table of runsums
Since every runsum is determined by its staring and ending number, we can make a table of the sums of integers between the two values:
Each entry in the table is the sum of the whole numbers starting at the from value on the left of its row and
ending at the to value at the top of its column. A few entries are shown in detail.
|SUMS|| To |
|3|| || ||3||3+4=7||3+4+5=12||18||25||33|| |
|4|| || || ||4||4+5=9||15||22||30|| |
|5|| || || || ||5||11||18||26|| |
|6|| || || || || ||6||13||21|| |
|7|| || || || || || ||7||15|| |
|8|| || || || || || || ||8|| |
|9|| || || || || || || || ||9|
So first fill in the rest of the entries in the table and then answer these questions:
Things to do
- 9 occurs in row 2 and column 4 and so the sum of the numbers from 2 to 4 is 9: checking: 2+3+4 is 9.
So by looking at the numbers in the table, we can find runsums.
Find two more locations in the table with 9 in it. What runsums are they?
- How many runsums can you find for 12?
- How many runsums for 15 can you find in the table?
- Use your table to find all the runsums of 2, 3, 4, 5, 6, 7, 8, 9 and 10.
There is only one runsum for 1 and for 2.
If there is more than one runsum for a number, write each runsum on a line of its own in the right box.
Put your results into a new table like this:
Is our table big enough to find all the runsums for 20?
No, because some of the lower rows do not go
far enough to the right. Extend your table so that you are sure all the numbers up to 20 are in your
extended table and then answer these questions:
Things to do
- Find all the runsums of 15
- Extend your new table of all runsums so that it includes all the runsums up to 20.
By placing coins (cans, boxes) in rows, one row above another,
we can make triangular patterns:
In these triangles, there are 1, 3, 6 and 10 balls.
How many will there be in the next triangle, the one with 5 on the bottom row?
The numbers in this series are called Triangular Numbers and we give them the names T(1), T(2),
T(3) and so on e.g.T(1) = 1, T(2) = 3, T(3) = 6. The tenth Triangular number's pattern will have 10 items on the bottom row and 1 on the top row, a total number of T(10) objects in it.
Looking at all the rows in one pattern above, the total number of boxes is:
1 = 1 in the first
1 + 2 = 3 in the second
1 + 2 + 3 = 6 in the third
1 + 2 + 3 + 4 = 10 in the fourth
and so on.
So can you now calculate T(10) without drawing it?
T(10) = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 = 55.
All triangular numbers are runsums - the special runsums that begin at 1.
T(n)'s longest row is of length n.
T(n) is the sum of the numbers from 1 up to and including n.
The first 12 Triangular numbers
Runsums and Triangular Numbers
If we look at a triangular pattern above and take off a triangle from the top of it, we will still be left
with a runsum, but the smallest row, the topmost one, will be bigger than 1. Here we take off T(3)=6 shown in green
This shows that T(6) - T(3)
= 21 - 6 =15. Looking at the red rows only we see
15 can be written as 4 + 5 + 6, a runsum.
This will work for any runsum. For instance, 11 = 5 + 6. The largest number in the runsum is 6 so we
start with T(6)'s triangle. But our runsum begins at 5, so we have removed T(4) = 1 + 2 + 3 + 4. Therefore
11 = 5 + 6 = T(6) - T(4)
Any runsum can be written as the difference between two triangular numbers
If N = a + (a+1) + ... + b then N = T(b) – T(a–1)
Note that a can be 1 so that N = T(b) –T(0) = T(b) and we include the triangular numbers themselves as runsums.
The shape of a triangle with its top cut off is called a trapezium and so runsums are also called
trapezoidal arrangements or trapezoids (in
article 1999.1.6 in the Journal of Integer Sequences, Vol 2 (1999)
by Tom Verhoeff of Eindhoven University of Technology).
Shyam Sunder Gupta's page on Triangular Numbers
is full of fascinating triangular number facts and formulae.
Numbers with several runsums
By looking at all the possibilities, we find that 4 cannot be
written as a runsum of more than a single number.
Every number has a runsum consisting of that number alone, so such runsums are "trivial" and we want to find "interesting" runsums!
Is 4 perhaps just a special case? Are there other numbers that have no "interesting" runsums? How can we
tell if a number has an "interesting" runsum or not?
Trivial and interesting runsums
Mathematicians call the single-number runsums trivial (meaning that they are not very interesting cases) and the others are
non-trivial or proper runsums (the interesting ones).
I went on looking for a proper runsum for 4 and 8, and I still couldn't find any.
Things to do
- Find another number that has no single runsums (hint: apart from 4, there is another one less than 10).
- What is the SMALLEST number that is a sum of a run of three numbers?
- What is the smallest sum of four numbers in a run?
- .. and five?
By spotting the pattern can you tell me what is the smallest number
which is a sum of one hundred consecutive numbers - but I want to know
HOW you know too!
I did notice that 9 was also interesting because it was the first number I
that had three different runsums:
9 = 2 + 3 + 4 = 4 + 5
Things to do
- I then found that 27 had four different runsums, what were they?
- What is the smallest number with four different runsums?
- I thought I'd see if I could find a number with five runsums but
when I was searching, I found a number with six runsums!
What is the smallest six runsum number that I could have found?
- How many numbers between 2 and 100 have six different runsums?
- While trying to answer the last question, I did find just one number with
exactly five runsums. What was it?
- There were still some numbers in the range
2 to 100 that seemed to have no runsums longer than one number.
Can you spot a pattern in the list of such numbers?
- What is special about the numbers with exactly three runsums (such as 9)?
A Runsum Calculator
Here is an online calculator that can help with your investigations.
It will instantly tell you that
- the sum of the numbers from 200 to 800 is 300500;
- there are 12 runsums for 9999 and it will show you what they are.
Here are some more investigations to do using the Runsum Calculator:
Things to do
- What is the sum of all the numbers from 2 to 8?
- from 20 to 80?
- from 200 to 800? [Why is it not 10 times the answer above?]
- Can you spot the pattern in these answers?
- Try the same thing but for 2 to 9, 20 to 90, etc. Is there a pattern now?
- What about 3 to 7, 30 to 70, and so on? Is there a pattern here?
- Try 10 to 14, 110 to 114, 1110 to 1114 and so on. How would you describe this pattern?
- Can you find more number patterns like these?
Please email me (address at foot of page) with your answers to
these questions and the results will be put on this site for others to see.
There are probably many kinds of
- A more advanced Project (age 15 and above):
Let's use the notation sum(a,b) to mean
the sum of all the numbers from a to b.
So sum(2,5) = 2+3+4+5 = 14.
- Find a formula for sum(1,b).
- What is the name for the series of numbers of the previous question?
- What is sum(10,20)?
- Suppose we know that sum(1,20) = 210
and sum(1,9) = 45, how can we use these
two values to compute sum(10,20)?
- Using your formula for sum(1,b), use it to write down a formula for
Here is my page of Runsum Facts and Figures which provides answers to many of the questions above.
Quick Ways To Calculate Runsums
First we find a formula for any runsum between two given numbers that is easy to remember
and then we adapt it to find an easier way to use it for computing runsums in your head without a calculator.
A Basic Formula and proof
If we want to sum the numbers from 10 to 20, we can arrange two copies of the numbers like this, the top one listing them forwards
form 10 to 20
and the bottom line with the numbers listed backwards from 20 down to 10:
Note that each column adds up to the same value: 30.
The first column is also just the first value plus the last.
How many columns are there? From 10 to 20 is 20-10 plus one = 11
Thus the sum of all the numbers in the table is 11 copies of 30 or 330.
This adds two copies of the list so the list 10 to 20 has a sum of 330/2 = 165.
This method applies to all lists of consecutive numbers from a to b.
Each column has the same sum: a+b and
there are b–a+1 columns.
So (b–a+1)(a+b) is twice the sum of the numbers from a to b:
Let's use sum(a,b) to mean a + (a+1) + (a+2) + ... + b
So our first forumula is
The second form gives us an easy way to remember this formula:
||(b – a + 1)(a + b)|| = (b – a + 1)||(a + b)|
sum(a,b) = number of values × average value
This formula is fairly easy to remember but not so good to use to calculate runsums in your head:
where the average value is (a + b)/2 and
the number of values is b – a + 1
Here is another example : What is the sum of the numbers from 6 to 20?
There are (20 – 6 + 1) = 15 columns each with a sum of 6 + 20 = 26. So twice the sum we want is
15 × 26. So the sum of the numbers from 6 to 20 is half of this: 15 × 13
(hmmm --- out with the calculator at this point perhaps!) which turns out to be 195.
An easier formula for mental arithmetic
Rearranging our formula above we have:
So, for sum(6,20) we have 202 = 400 and
62 36, with a difference of 364.
|sum(a,b) = |
|(b – a + 1)(a + b)|
|2|| = |
|b2 – a2 + b + a|
is (the difference of the squares of a
PLUS their sum) over 2
The sum of 6 + 20 = 26 which we add on to 364
to get 390. Halving this we have 195 as before.
These sums are make excellent practice for your mental arithmetic skills!!
Friends and Neighbours
Where a number (sum) has more than one runsum, we can find more patterns. In this section we look for
have one number in common such as 2 + 3 + 4 = 4 + 5.
Since the runsums have something in common, we will call them friends.
Other pairs of runsums (for the same sum) are neighbours if
one starts with the value next to where the other ends, such as in 4 + 5 + 6 = 7 + 8.
We are calling the two runsums 2 + 3 + 4 and 4 + 5
friends since they have the same sum and share a number in common (4),
so that one
runsum starts where the other ends.
Are there any more?
21 is the sum for the next pair of friends:
1 + 2 + 3 + 4 + 5 + 6 = 6 + 7 + 8 .
There are quite a lot of friendly runsums
when you start to look.
The sums with the pair of friendly runsums here are 9 and 21 and the series of such sums is:
and continues with 99, 105, 117, 133, 135, 154, 175, 180, ...
The common numbers in these friendly runsums are
4,6,9,11,14,15,16 and the series continues indefinitely (see Sloane's
If we omit the common number, the new series of sums is:
5,15,21,33,54,54,85,90,100, ... (see Sloane's
A Behera and G K Panda in a paper entitled On The Square Roots of Triangular Numbers
in Fibonacci Quarterly, 1999, pages 98-105, use the term balancing number
for the number common to two Friendly runsums where both of the following conditions must hold:
We have 2 + 3 + 4 = 4 + 5 but
4 (the common number) is not a balancer since neither of its runsums
begins with 1.
- both runsums consist of more than one number
- one of the two runsums begins at 1
However, 6 is a balancing number since
1 + 2 + 3 + 4 + 5 + 6 = 6 + 7 + 8
They call the number of terms in the runsum commencing n + 1 the
balancer. Thus for the balancing number 6, we have the balancer 2 because
1 + 2 + 3 + 4 + 5 + 6 = 6 + (6+1) + (6+2)
Behera and Panda show that there is a connection between the balancing number n and
a balancer r as follows:
and so n2 must be a Triangular number and 8 n2 + 1 must be a perfect square.
|n2|| = ||(n + r)(n + r + 1)|
|r = || √(8 n2+1) – 2n – 1 |
They also show that in the sequence of balancing numbers, each is 6 times the previous number minus the number before that:
This is A001109:
1, 6, 35, 204, 1189, 6930, 40391, 235416, ....
|B(0) || = || 1|
| B(1) || = || 6|
|B(2) || = || 35|
|B(i) || = || 6 B(i–1) – B(i–2) for i > 2|
In the same way that the Fibonacci Numbers have a Binet Formula
which explicitly gives Fib(n) in terms of n,
the balancing numbers have the formula:
In the same way that the ratio of Fibonacci numbers tends to Phi,
the ratio of balancing numbers tends to G
and it has the periodic continued fraction expansion of 5, [1, 4] or [6, –6]:-
|B(n) = ||Gn+1 – gn+1|| where G = 3 + √8, g = 3 – √8|
|G – g|
K Liptai in Fibonacci Balancing Numbers, Fibonacci Quarterly,2004, pages 330-340, showed that 1
is the only Fibonacci number that is a balancing number too.
|6 + |
|–6 + |
Here are two runsums of 15: 4 + 5 + 6 = 7 + 8. Notice that second continues the run started in the first and
also that the two runs have the same sum.
So instead of two runsums (of the same sum) sharing a common value as in Friends above, we now find runsums
that fit together as neighbours: as one runsum ends, the other continues without a break. We call such runsums
neighbours since they are runs that are next to each other.
27 has two neighbouring runsums:
2 + 3 + 4 + 5 + 6 + 7 = 8 + 9 + 10 = 27
The ordered sequence of sums with two neighbouring runsums is:
15 = 4+5+6 = 7+8
and continues with 105,135,147,165 ...
(see Sloane's A110703)
27 = 2+3+4+5+6+7 = 8+9+10
30 = 4+5+6+7+8 = 9+10+11
42 = 9+10+11+12 = 13+14+15
75 = 3+4+5+6+7+8+9+10+11+12 = 13+14+15+16+17
90 = 16+17+18+19+20 = 21+22+23+24
Now have a look at the next page on Runsums
© 1999-2015 Dr Ron Knott
Created 1999; last updated on 22 June 2015