On this page, we look at writing whole numbers as a sum of
a sequence of consecutive odd numbers: a run of odd numbers.
They relate to expressing numbers as the difference of two squares,
factoring. Also, the main aim of this page, is we show
that every power has is an odd run sum, every fraction is the ratio of two oddrunsums and find some beautiful patterns in these.
The calculators on this page require JavaScript but you appear to have switched JavaScript off
(it is disabled). Please go to the Preferences for this browser and enable it if you want to use the
calculators, 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.
Odd runs and their sums
A run of consecutive odd numbers is an oddrun
A run of consecutive odd numbers is called an oddrun.
For example,
3 + 5 + 7 is an oddrun as is
5, a single odd number, but
3 + 5 + 11 is not because the odd numbers are not consecutive and
3 + 4 + 5 is not because it contains an even number.
We can include negative odd numbers too so that
-3 + -1 + 1 + 3 + 5 + 7 is also an oddrunsum which after we cancel out the negative odds
is as the same as 5 + 7.
Oddrunsums that do not begin with 1 can have two forms,
one beginning with a positive odd number and an equivalent one beginning with a negative odd number.
We will usually count these as the same run of odd numbers because they have the same sum.
Any number that is the sum of an oddrun is an oddrunsum.
so 15 is an oddrunsum as it is 3 + 5 + 7.
The length and centre of an oddrun
The length and the centre
The number of odds in the run is called its Length.
The oddrun 3+5+7+11 has length 4 because there are 4 odd numbers in the run.
The oddrun 5 consisting of a single odd number has length 1.
The range of an oddrun is the beginning and the end of the run of odd numbers:
3+5+7 has begins at 3 and ends at 7.
A sum of consecutive odd numbers has an average value which is always an integer.
The average of the run is the sum of the odd numbers divided by the length of the run (the number of odds in the run).
The average is called the Centre of the run.
The Length×Centre Theorem
Centre = Sum / Length
⇔Sum = Length × Centre
If the length of the run is odd
then there is a central odd
value in the run and for every odd number on one side of this centre, there is also a balancing number
the same distance away
on the other side of the centre. For example, 5+7+9+11+13 has an average value of 9,and 7 is
center−2 balanced by 11 which is
the centre+2; 5 is balanced by 13.
If the run is of even length,
then the centre (average) is between two consecutive odd values in the run. For example
3+5+7+9 has a centre of 6, between 5 and 7.
Again, each odd in the run which is d below the centre has a matching value in the run which is d above the centre.
Thus, in both cases, the sum of a run of consecutive odd numbers is equal to the centre times the length.
If the sum is S and there are L odds in the run then the centre C is S/L (by definition of the average value).
In other words,
the sum S is Length×Centre is an integer value,
means that the sum S is divisible by both its length L and its centre C.
Notation
Let's write the
the sum of all the odds in the range from beginning B to end E~ as
because the "o" in the symbol means "odds" and there are only odd numbers in the run
and the + symbol indicates that we add the odds between these limits to form the sum.
might mean the actual run of odd numbers or sometimes
just its sum.
For example:
= 3 + 5 + 7 = 15.
This is the same run as because
in −1+1+3+5+7 we can cancel each negative odd with a positive odd number.
This notation is useful when an oddrun is long to write out in full.
Also, since the Sum of an oddrun is Length × Centre, we will write
the odd run as .
The oddrun of length 3 with centre 11 is 9+11+13 which we can write as
because its sum is 3×11 = 33.
Since an oddrunsum can be given as a range
For example: 5+7+9 =
Oddrunsums are the difference of two square numbers
If an oddrun begins at 1 then the sum of the odd numbers from 1 to (2b-1) is b2
If the run is just a single number, say 2a-1
then it too is the difference between a2 and (a−1)2:
a2 − (a−1)² = a² − (a² − 2a + 1) = 2a − 1.
Therefore:
Every oddrunsum is the difference of two squares.
The Centre and Length are both odd or both even
If S is an oddrunsum then S=L×C so S=((C+L)/2)2 − ((C-L)/2)2
which means that C+L and C−L must both be even to make sure the start and end of the odds run are integers.
If C is even then L must be too and if C is odd then so must L be.
In other words,
The Centre and Length must both be odd or both be even
To find the oddrunsum with sum b²−a², use the result that
b² − a² = (b + a)(b − a)
which is true even if a is 0.
Use one factor as the centre C and the other (S/C) as the length L.
For example 72 = 9² − 3² = (9−3)(9+3) = 6×12
So an oddsrun with sum 72 can have length 6 and centre 12: 7 + 9 + 11 + 13 + 15 + 17.
Another way to do this is to have centre 6 and length 12 which involves negative numbers: -5 + -3 + -1 + 1 + 3 + 5 + 7 + 9 + 11 + 13 + 15 + 17
which reduces to the same oddsrun that we already found.
Fermat in 1643 (see L E Dixon in references below) knew that using a pair of factors of a number,
the number could be expressed as a difference of two squares.
Is every number an oddrunsum?
You do the maths...
Try to write each number from 1 to 20 as a sum of a sequence of consecutive odd numbers,
remembering that a single odd number qualifies as a run.
Show that all square numbers are of the form 4k or 4k+1 and never 4k+2 nor 4k+3.
What does this imply about the possible remainders of the difference of two squares, when divided by 4?
The 4 possible remainders when dividing by 4 are 0, 1, 2 and 3.
if N has remainder 0, then N² is (4k)² and also has remainder 0 when divided by 4.
if N has remainder 1, then N² is (4k+1)² = 4(4k² + k) + 1 so has remainder 1.
if N has remainder 2, then N² is ((4k+2)² = 4(4k² + 4k + 1) with remainder 0.
if N has remainder 3, then N² is (4k+3)² = 4(4k² + 12k) + 4×2 + 1 with remainder 1.
So square numbers only have a remainder of 0 or 1 when divided by 4.
Checking the cases for B² − A² we find they all have remainder 0,1 or 3 when divided by 4, and
never a remainder of 2.
We use this result in the next section on this page.
Make a table of the oddrunsum that starts at B and ends at E, both odd numbers,
with the rows labelled B from 1 to 21 and the columns labelled E from 1 to 21. Leave the entry blank
if B>E. The entry on the row labelled B and in the column labelled E
will be the sum of the odds from B to E. There is a short-cuts you can use to fill in one row using the row above it.
Use the table to count the number of the number of oddruns for each sum from 1 to 21 by counting how manby times
the number appears in your table.
B\E
1
3
5
7
9
11
13
15
17
19
21
1
1
4
9
16
25
36
49
64
81
100
121
3
.
3
8
15
24
35
48
63
80
99
120
5
.
.
5
12
21
32
45
60
77
96
117
7
.
.
.
7
16
27
40
55
72
91
112
9
.
.
.
.
9
20
33
48
65
84
105
11
.
.
.
.
.
11
24
39
56
75
96
13
.
.
.
.
.
.
13
28
45
64
85
15
.
.
.
.
.
.
.
15
32
51
72
17
.
.
.
.
.
.
.
.
17
36
57
19
.
.
.
.
.
.
.
.
.
19
40
21
.
.
.
.
.
.
.
.
.
.
21
Counts of the number of times an entry appears in the table above:
n
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#oddruns
1
0
1
1
1
0
1
1
2
0
1
1
1
0
2
2
1
0
1
1
2
So we see that some numbers are not the sum of a run of consecutive odd numbers.
Let's see if we can identify all of them.
We have seen that
The Centre and Length must both be odd or both be even
and this implies that S = L×C, the sum of the run, is : either a multiple of 4 if both L and C are even or else S is odd if both L and C are odd.
We cannot have an oddrunsum S that is twice an odd number, that is, a sum
of the form 4k + 2!
The other numbers are all the sum of an oddrun.
The numbers 2,6,10,14,18,22,... of the form 4i+2 are not oddrunsums:
Those that are an oddrunsum are: 1, 2 , 3, 4, 5, 6 , 7, 8, 9,
10 , 11, 12, 13, 14 , ... A042965
How to find oddsruns for a given sum
Here is a way to use the above results to find oddruns for any given number as the sum,
provided the sum is not odd when halved and provided Length and Centre are both even
or both odd, or, in other words, L(ength) and C(entre) have the same parity.
For example 36 has these combinations of two factors, L and C
Length?
1
2
3
4
6
9
12
18
36
Centre?
36
18
12
9
6
4
3
2
1
same parity?
✗
✓
✗
✗
✓
✗
✗
✓
✗
oddrun
b2−a2
102−82
62− 02
102−(−8)2
A Calculator for finding oddruns
Odd Run Sums C A L C U L A T O R
For Sum= to sum
showing
length¢re:
negative start:
a2−b2:
as a list:
R E S U L T S
means the odds in the range B to E means
L is the length of the run with C as the centre (average)
If an oddsrun begins at P and ends with Q, both odd numbers,
find an expression for its sum S, its centre C and its length L.
If P is (2a+1) and Q is (2b-1) then according to the formula
in the Difference of Two Squares section above:
the sum S = b2 − a2 = ((Q+1)/2)2 − ((P-1)/2)2
The centre C = a + b = (Q + P)/2
The length L = b − a = (Q+1)/2) − (P-1)/2) = (Q − P)/2 + 1
Show that if
with B>1 then the equivalent oddrun with the same end value E and the same sum
but starting with a negative odd number is .
From the previous answer:
with center C=(B+E)/2 and length L=(E-B)/2 + 1
= -(B-2)-...-1 + 1+3+...+(B-2) + B+(B+2)+...+(E-2)+B
with center (E-B+2)/2 =(E-B)/2+1 = L and length (E+B-2)/2+1=(E+B)/2 = C
In how many ways can a prime number be an oddrunsum?
Since all primes above 2 are odd numbers, they are already runs of length 1.
To have another oddrunsum they must be of the form C×L but there are no more factorizations for prime numbers.
Hence odd primes are oddrunsums in only one way, the number itself.
Find all the numbers up to 30 that have an oddrun of length 2 and so find a formula for them all.
Numbers with odds runsums of length 2:
4 = 1 + 3
8 = 3 + 5
12 = 5 + 7
16 = 7 + 9
20 = 9 + 11
24 = 11 + 13
28 = 13 + 15
These are just the multiples of 4
A number of the form 4i for any i is an oddrunsum of length 2
Find all the numbers up to 30 that are an oddrunsum with length 3 and so find a formula for them all.
Numbers with odds runsums of length 3:
9 = 1 + 3 + 5
15 = 3 + 5 + 7
21 = 5 + 7 + 9
27 = 7 + 9 + 11
The general formula is 6i + 3 (i>0)
How many oddruns are there for a given number?
Earlier we saw that some numbers are not the sum of any oddruns:
those which are twice an odd number.
We have seen that 36 is the sum of 2 oddruns:
and 17+19.
We are not now counting the
oddruns that begin with a negative number since they are equivalent to one starting with positive number, but we will include a
single odd number as an oddrun of length 1.
A formula for the number of oddruns
Is there way to calculate the number of oddruns for a given sum without fully factoring the number?
Here is a table of the number of oddruns for some small numbers.
n
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#oddruns
1
0
1
1
1
0
1
1
2
0
1
1
1
0
2
2
1
0
The number of ways of representing n as an oddrunsum is A034178.
The table is also the number of ways of expressing n as the difference of two (positive) square numbers.
The first number with two oddruns is 9:
9 = 9
9 = = 1 + 3 + 5
The next are 15 and 16:
15 = 15
15 = = 3 + 5 + 7
16 = 7 + 9
16 = = 1 + 3 + 5 + 7
There is a formula for the number of ways that a given number n can be written as an oddrunsum
which only involves testing the remainder when n is divided by 4:
#oddruns for n
= 0
if n ≡ 2 (mod 4)
= floor( (nbdivisors(n)+1)/2 )
if n ≡ 1 or 3 (mod 4)
= floor( (nbdivisors(n/4)+1)/2 )
if n ≡ 0 (mod 4)
floor(n) is the greatest whole number ≤ n nbdivisors(n) is the number of ways n is a product of two whole numbers where order matters
For example
8
8 has a remainder of 0 when divided by 4.
#oddruns of 8 is therefore floor( (nbdivisors(n/4)+1)/2 ).
The divisors of 8/4 = 2 are 1 and 2 floor( (2+1)/2 ) = floor(3/2) = 1
#oddruns of 8 = 1
9
9 has a remainder of 1 when divided by 4.
#oddruns of 9 is therefore floor( (nbdivisors(n)+1)/2 )
The divisors of 9 and 1,3,9 so the formula gives
#oddruns of 9 = floor( 4/2 ) = 2
10
10 has a remainder of 2 when divided by 4 so has 0 oddruns (it is twice an odd number).
Counting only oddruns of length >1
If we did not want to count a run of a single number as a run, then since that would only apply to
odd numbers, we just subtract 1 from the middle line of the formula, for n ≡ 1 or 3 (mod 4).
This alters the counts for the odd numbers:
Note that is it not a purely increasing sequence since 480 has 8 oddsruns but the first with 7 was 768.
If we only count runs of length > 1 then
the counts are A220400
n
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#oddruns L>1
0
0
0
1
0
0
0
1
1
0
0
1
0
0
1
2
0
0
0
1
1
0
0
2
and the records for the smallest number n to have 2,3,4,... oddruns of length>1 are now
just 1 oddrunsum with L>1: 4,
first with 2 oddrunsums with L>1: 16
with 3: 48, then 96, 144, 240, 480, 720, 960, 1440, ... A297160
You do the maths...
Remember that the second square can be 0 in "a difference of two squares".
Find all the 4 ways of writing 96 as an oddrunsum and as a difference of two squares.
Check using the Calculator above or
Find all the ways of writing 480 as an oddrunsum and as a difference of two squares.
Check using the Calculator above or
Its factor pairs are as follows with the opposite parity ones dimmed:
480 = 25×3×5
= 1×480
= 2×240 =3×160
= 4×120 =5×96
= 6×80
= 8×60
= 10×48
= 12×40 =15×32
= 16×30
= 20×24
so there are 8 oddruns and differences of two squares.
All powers are oddrunsums!
Though many numbers are missing from the list of those numbers that are oddrunsums,
the perhaps surprising result is that
all powers of whole numbers greater than 1 are in the list: they are all oddrunsums!
Even more precisely we can say that
Every power nk (n>1 k>1, whole numbers) is an oddrunsum of length n
This is an excellent result on which to practice your proof by induction technique.
First we can show that every square number (power 2) has an oddrunsum. This is because the sum of the first n odd numbers from 1 is n2
that we saw in the Difference of Two Squares section above.
Then, using the Length×Centre Theorem
if we choose nk−1 as the Centre
and n odd numbers around it (so its length is n), then
we have an oddrunsum for nk−1n which is nk.
Oddruns for Powers Calculator
This Calculator will show how many oddruns there are for very large numbers
as the base of the power (up to 16 digits).
Oddruns for Powers C A L C U L A T O R
Find oddrunsums for a power of a whole number
Power:
Show
:
:
a²-b²:
R E S U L T S
means the odds in the range B to E means
L is the length of the run with C as the centre (average)
Take the prime 2 and find out in how many ways its powers are oddrunsums.
What result does this suggest?
22 and 23 each are the sum of 1 oddrun
24 and 25 each are the sum of 2 oddruns
26 and 27 each are the sum of 3 oddruns
... 22k and 22k+1 each are the sum of k oddruns
Take any odd prime number and find out in how many ways its powers are an oddrunsum.
What result does this suggest?
For all odd primes we have
p2 and p3: both are the sum of 2 oddruns
p4 and p5: both are the sum of 3 oddruns
p6 and p7: both are the sum of 4 oddruns
... p2k and p2k+1: both are the sum of k+1 oddruns
Take any a product of two odd primes and count the number of ways
it is an oddrunsum.
What result does this sugest?
Numbers which are the product of two different primes are
6,10,14,15,21,22,26, ... A006881
pq, both odd primes, to the power k is the sum of ceiling((k²-1)/2) oddruns
(see A007590)
Writing Fractions with oddrunsums
This fractions section and, indeed, this whole page, was inspired by this series of oddrunsums
for the fraction 1/3
1
=
1+3
=
1+3+5
=
1+3+5+7
= ...
3
5+7
7+9+11
9+11+13+15
All fractions have such a series of a ratio of odd run sums and
in an infinite number of ways! The Calculator below will find these and we show why this is true after
the Calculator.
Using the calculator below you can find all the oddruns for numerator and denominator
for any fraction A/B when written as (kA)/(kB)
and for as many k as you like.
For instance, for the fraction 1/3 we also have
1
=
1+3+5
=
3+5+7
=
5+7+9
=
7+9+11
= ...
3
7+9+11
13+15+17
19+21+23
25+27+29
and here are some other fractions also with interesting number patterns that go on for ever:
1
=
1+3
=
3+5
=
5+7
= ...
2
3+5
7+9
11+13
1
=
3+5
=
5+7
=
7+9
= ...
2
1+3+5+7
3+5+7+9
5+7+9+11
2
=
3+5
=
7+9
=
11+13
= ...
3
5+7
11+13
17+19
2
=
3+5+7+9
=
5+7+9+11
=
7+9+11+13
= ...
3
1+3+5+7+9+11
3+5+7+9+11+13
5+7+9+11+13+15
1
=
1
=
3
=
5
= ...
4
1+3
5+7
9+11
1
=
3
=
3+5
=
3+5+7
= ...
4
5+7
5+7+9+11
5+7+9+11+13+15
You do the maths...
Express each series of the oddruns in each of the fractions above in a formula in n and the
operation.
1
=
1+3
=
1+3+5
=
1+3+5+7
= ...
=
n⊗n
3
5+7
7+9+11
9+11+13+15
n⊗3n
1
=
1+3+5
=
3+5+7
=
5+7+9
=
7+9+11
= ...
3⊗(2n+1)
3
7+9+11
13+15+17
19+21+23
25+27+29
1
=
1+3
=
3+5
=
5+7
= ...
=
2⊗2n
2
3+5
7+9
11+13
2⊗4n
1
=
3+5
=
5+7
=
7+9
= ...
2⊗2n
2
1+3+5+7
3+5+7+9
5+7+9+11
4⊗2n
2
=
3+5
=
7+9
=
11+13
= ...
=
2⊗4n
3
5+7
11+13
17+19
2⊗6n
2
=
3+5+7+9
=
5+7+9+11
=
7+9+11+13
= ... =
4⊗2n
3
1+3+5+7+9+11
3+5+7+9+11+13
5+7+9+11+13+15
6⊗2n
1
=
1
=
3
=
5
= ... =
1⊗(2n−1)
4
1+3
5+7
9+11
2⊗(4n-2)
1
=
3
=
3+5
=
3+5+7
= ...
n⊗(n+2)
4
5+7
5+7+9+11
5+7+9+11+13+15
2n⊗(2n+4)
L and C of opposite Parity for even run sums
If the Length and the Centre are of opposite parity, then we can find a run of even numbers
with this length and centre:
L is even and C is odd
If the length of a run (of odd or even numbers) is even then its centre is not a member of the run
but is between two members of the run.
For example L=4 and C=5:
If L=4 then there are two numbers either side of the centre C: 2+4 +6+8 = 20 =
L is odd and C is even
The length is odd so the centre IS a member of the run. But C is even so the run can be of even numbers:
For example: L=5 and C=6:
If L is 5 then there are two numbers on either side of (the included) centre C: 2+4+ 6 + 8+10 = 30 =
Oddruns for all Fractions Calculator
You might find that using the
form of an oddrun is useful in spotting
patterns in the RESULTS of the Calculator.
This Calculator allows you to look for oddruns and also evenruns.
Oddrun for Fractions C A L C U L A T O R
For fraction
×k
×k
with k from to
Show run:
:
:
a²-b²:
R E S U L T S
means the odds in the range B to E means
L is the length of the run with C as the centre (average)
Do all fractions have an infinite oddrunsum pattern?
If the fraction has an odd number in the numerator or in the denominator then that is already
an oddrunsum of length 1. This is not very interesting so let's see
if we can get an oddrunsum of more than one odd number
in the numerator or in the denominator.
If a numerator or denominator is not prime, then it can be written as L×C with L greater than 1
and so is the oddrunsum . However, we need L and C to have the same parity
if it is to be an oddrun. So if both numerator and denominator are of the same parity, choose values of k with that parity.
For instance, with both numerator and denominator odd numbers:
3
=
3×5
=
=
5
5×5
=
3×7
=
=
5×7
=
3×9
=
=
5×9
=
3×k
for odd k≥5,...
5×k
For opposite parity parts choose multiples of 4 for k. This is so that we can use 2k×(2×odd part)
and 4k×(even part) to ensure both L and C are even. For instance, with odd numerator N
and even denominator D
we can use, for example, use 2N × (2k) as numerators and
2D × (2k) as denominators so that both oddruns lengths and centres are always even.
If we prefer L to be less than C for our oddrunsums to make sure that all values in the runs are positive,
then we can choose a suitable value to start our multiples from. For instance
N=3 and D=4:
3
=
2×(2×3)
=
=
4
4×4
=
4×(2×3)
=
=
4×8
=
6×(2×3)
=
=
4×12
A general pattern for odd numerator and even denominator is:
N
=
D
In the above pattern will eventually the lengths will eventually exceed the centres and so we
would need to see negative odd that starts the oddrun to
appreciate the pattern.
Here is a variant where the numerator and the denominator are both doubled so that
this pattern applies for all numerators and denominators:
N
=
D
for all values of k=1,2,3,...
To maintain a positive starting value of all the oddruns then let k start at the
largest of N and D.
For example, for 3/4, start k at 4:
3
=
(2×3)×8
=
=
4
(2×4)×8
=
(2×3)×10
=
=
(2×4)×10
=
(2×3)×12
=
=
(2×4)×12
There are often other patterns if we choose a different factorization of the multiples of the numerator
and denominator.
Every fraction N/D can be written with an oddrun of more than one odd number
in both the numerator and the denominator
So the answer is Yes!
Any fraction can be written in an infinite number of ways
using the patterns of oddrunsums.
You do the maths...
Show that very fraction can be written as a ratio of two oddruns of length 2 or length 3 only.
If the numerator and denominator are:
Both odd:
If both are >1:
If the Num or Den are 1 use the fraction
One odd, one even:
replace the odd one with
replace the even one with
Both even:
Reduce the fraction to one of the cases above.
Illustrate question 1 by filling in this table of fractions from 1/2 to 4/5
with oddruns of length 2 or 3 as numerators and denominators:
Num/Den
/2
/3
/4
/5
1/
?/?
?/?
?/?
?/?
2/
?/?
?/?
?/?
3/
?/?
?/?
4/
?/?
Num/Den
/2
/3
/4
/5
1/
2/
see 1/2
3/
4/
Find three more oddrunsum patterns for the fraction 1/4
that are different from the two at the start of this section.
1
=
1
=
1 + 3
=
1 + 3 + 5
=
1 + 3 + 5 + 7
=
=
4
1 + 3
1 + 3 + 5 + 7
1+3+...+9+11
1+3+...+13+15
1
=
1+3
=
3+5
=
5+7
=
7+9
=
=
4
1+3+5+7
5+7+9+11
9+11+13+15
13+15+17+19
1
=
3
=
5 + 7
=
7 + 9 + 11
=
=
4
5 + 7
9+11+13+15
13+15+...+21+23
Even runs
Some examples with even runs where odd runs are shown like this and
even runs like this:
Are there more for 5/8?
References
Problem 1717 E T H Wang, Crux Math (1993) page 30
Gives the formula for the number of oddrunsums for any given number.
Every Cube is the sum of consecutive odd numbers: Proof without words R B Nelson
Mathematics Magazine (1993) Vol 66, p 316
JSTOR PDF
This is generalized by the next Reference here but this paper gives a visual proof - a proof without words.
Powers of integers are sums of consecutive odd numbers Junaidu et al.
Math Gaz (2010) vol 9, pages 112-119
An odd sum R C Shiflett, H S Shulyz Maths Teacher Vol 95 (2002),
pp 206-209 JSTOR PDF. This article does not count a single odd number as a run,
and calls an oddrunsum of more than one number odd-summing.
This article include proofs of counting results with their alternative
definition (that odd runs are only of length at least 2).
A note on the sequence of odd integers R W Shoemaker, Maths Teacher
vol 47 (1954) pp 489-490 JSTOR PDF
is about powers of integers and oddrunsums but using different centres than we do on this page.