Formulae inquiry

The prompt

Mathematical inquiry processes: Generate examples and counter-examples; conjecture, generalise and prove; analyse structure. Conceptual field of inquiry: Formulae linked to arrays; algebraic expressions.

The prompt is suitable for all classes in secondary school, with the amount of a teacher's guidance and instruction contingent on the students' level of independent inquiry skills and mathematical knowledge.

The inquiry starts with questions and statements about the prompt:

After the initial stage the teacher might define the variables, at least at the start of the inquiry, as follows: l - length of the rectangle, h - height of the rectangle, n - number of lines or sticks.

The prompt intrigues students and they search enthusiastically for other arrays with lengths and widths that satisfy the formula. They quickly realise that the formula does not work in most cases. 


So what is it about the rectangle in the prompt that is special? Could it be that the length of the array is twice the height? Or do both the length and height have to be multiples of three? The teacher should share students' conjectures as they arise in the inquiry.

The formula works for the array in the prompt because the length and height are consecutive triangular numbers. If students do not 'discover' this themselves, the teacher can lead them towards the idea using the examples they have (see the Exploration section below).

There are a variety of lines of inquiry at different levels of challenge that follow from this first phase. Three are outlined in this PowerPoint designed for a structured inquiry.

Updated January 2024


If the class explores systematically, students soon find the smallest case that satisfies the formula (length 3, height 1). This leads to speculation that the next one after the 3-by-1 and 6-by-3 rectangles is 9-by-6 by using multiples of three

That proves to be close but not quite right. The teacher encourages students to change the length or height by one and check.

With the first three results involving 1, 3, 6, and 10 the teacher focuses students' attention on the sequence. If the class does not recognise the triangular numbers, then the teacher reminds them of the sequence - perhaps supporting an explanation with diagrams.

Another period of exploration might follow when the teacher asks if the triangular numbers have to be consecutive. 

Deducing a formula and proof

An analysis of the structure of the array helps students develop another formula for the number of lines. The formula works for all rectangular arrays. 

By colouring the lines in the way shown in the illustration, students can understand how to develop a formula from the structure of the array. There are 4 x 6 red lines, where 6 is the length and 4 is one more than the height. Similarly, there are 7 x 3 green lines, where 3 is the height and 7 is one more than the length. 

As any rectangular array can be represented by horizontal and vertical lines in this way, the formula for the number of lines in any rectangular array is: l(h + 1) + h(l + 1).

Students can complete a table (the one below is from a year 10 student) to verify that, for consecutive triangular numbers, both formulae give the same answer.

See mathematical notes 1 for a proof that if l and h are consecutive triangular numbers, then l2 + h2 = l(h + 1) + h(l + 1).

The proof below comes from Amelia (a year 10 student at Longhill High School, Brighton, UK). After being given the general expressions for two consecutive triangular numbers, she produced the proof independently.

If-and-only-if proof

Would any two consecutive numbers satisfy the formula? Or must they be consecutive?

Dr Daniela Vasile (Head of Mathematics at South Island School, Hong Kong) gave the formulae prompt to some of her year 11 students who are doing the Cambridge Additional Mathematics qualification. 

Daniela explains how the inquiry developed: 

The students worked through and found the pattern - sides of the rectangle being consecutive triangular numbers.

Then I asked, are we sure that all pairs of consecutive triangular numbers fulfill the condition? It was not difficult for them to prove it true, but my next question was: Are we sure that there are no other pairs verifying the condition? They struggled with this proof, so we did it together. The prompt turned into a very nice if-and-only-if one - I really enjoyed it!

Daniela sent the proof to the Inquiry Maths website.

Lines of inquiry

1. Arrays in other shapes

The method to deduce a formula can be generalised to arrays of other shapes - for example, equilateral triangle, rhombus, and hexagon. (See mathematical notes 2.)

2. Gaps between the lines

Is there a formula for the number of gaps between the lines? Are there formulae for the different types of gaps? In a rectangle, there will '2-gaps' where two lines meet, '3-gaps' where three lines meet and '4-gaps' where four lines meet.

In the prompt there are 4 2-gaps, 14 3-gaps, and 10 4-gaps. Students might collect more results and attempt to find a generalisation by spotting patterns. They will notice that there are always 4 2-gaps (in the corners), but struggle to find expressions for 3- and 4-gaps.

To find those, an analysis of structure is better. The 3-gaps are on the perimeter. The total is the sum of two lots of one less than the length and two lots of one less than the height. The 4-gaps are in the centre. The total of 4-gaps is the product of one less than the length and one less than the height.

3. The array only

Although the inquiry teacher might wish to insist that students consider the array and the formula together, comments that relate to the array separately can lead the inquiry down different pathways. They include the following:

The first line of inquiry leads to the question 'How many squares are there in a rectangular array? Again a structural approach can lead to formulae for the different sized squares and one for the total number of squares.

The second line of inquiry can lead to students extending the array to form a sequence of arrays all with a height of three. If a 1-by-3 array is taken as the first in the sequence, the nth term of the number of lines is 7n + 3 (where the +3 are the first three lines on the left of the array).

A year 9 class decided to find as many sequences of arrays as possible that include the one in the prompt and then find their nth term.

4. Computer programming to develop inquiry

During an Inquiry Maths workshop at Mulberry Academy (Shoreditch, London) in June 2019, Duygu Gumus deduced the relationship l - h = √(l + h). In the interval, Lauren Gillott wrote a programme in Python to generate all the pairs of l and h that satisfy the equation up to 1000. Amy Flood (Head of Mathematics) talked of her plans to incorporate Inquiry Maths into the department's schemes of learning, "We are excited to begin creating inquiry lessons and inquiry classrooms in order to develop students' reasoning."

import math

for i in range(1000):

 for j in range(1000):

if (i - j) == math.sqrt(i + j):

print(str(i) + '   ' + str(j))

Lauren Gillott is 2 i/c in the mathematics and computer science department; Duygu Gumus is a teacher of mathematics and deputy director of sixth form. 

5. Using GeoGebra to explore

During an Inquiry Maths workshop at the Swiss Mathematics Conference for secondary teachers in Geneva (February 2018), Dan Pearcy designed a tool on Geogebra that allows students to explore the prompt and find other cases that are consistent with the formula.

ATM conference 2016

The formulae prompt was used in the Inquiry Maths workshop at the 2016 conference of the Association of Teachers of Mathematics. Initial questions included:

After agreeing on definitions of the terms l, h and n, we paused to consider the regulatory cards. The majority of the 30 participants selected either Decide what the problem is or Try to find some more examples, although a strong argument was made for Think about the structure in order to avoid an unsystematic search for more cases.

After a period of working on the prompt, colleagues fed back their findings. Dave showed how l2 + h2 = l(h + 1) + h(l + 1) simplified to (l - h)2 = l + h

Then Sabrina used the result to show how she had found more rectangles that satisfied the formula using this table:

Luke described how he had used the same result to develop an exhaustive method for finding rectangles. Finally, Julian explained how he and Jo had developed their approach using simultaneous equations to deduce that l and h had to be consecutive triangular numbers. Julian's note sheet is shown below. The approach he presented to the session follows.

(l - h)2 = l + h

Making l - h = x [A], then l + h = x2 [B]

[A] + [B] gives 2l = x2 + x and  l = x(x + 1)/2

[A] - [B] gives 2h = x2 - x and  h = x(x - 1)/2

x(x + 1)/2 and x(x - 1)/2 are expressions for consecutive triangular numbers.


The formulae prompt was the starting point for an inquiry in the inquiry maths session at the British Congress of Mathematics Education (April 2014). Some of the questions and comments are shown above.

As would be expected of some of the UK's foremost maths educators, the responses to the prompt could take the inquiry in multiple directions. Mike Ollerton categorised the gaps between the sticks as "2, 3- or 4- hole". The ratio of squares to lines (sticks) is a novel idea. The participants at the session decided either to follow their own strands of inquiry or to focus on the questions in the box at the top of the sheet.

Kate Bell presented her approach to the other participants. She deduced that the sum of l and h equals a square number, specifically the square of their difference.    

l2 + h2 = l(h + 1) + h(l + 1)

l2 + h2 = 2lh + h + l

l2 - 2lh + h2 = l + h

(l - h)2 = l + h

Kate was reminded of a problem involving this diagram (below), which shows that this is a property of two consecutive triangular numbers.

After the session, Dominic Penney said that the key point he would take away was that Inquiry Maths is not about unsupported individual exploration. Rather, the teacher participates in directing the inquiry while giving the students as much responsibility as possible. The class develops the inquiry together, discussing its direction and content at regular points. Dominic described it this way: "We are all on the same platform and then we jump off together."

During the Inquiry Maths session at BCME 9, Becky Warren (NRICH) and Michael Anderson (National STEM Learning Centre) arrived at:

l2 + h2 = l + (2l + 1)h

Rearranging gave them: h2 - (2l + 1)h + (l2 - l) = 0

Using the quadratic formula, a = 1, b = -(2l + 1), c = l2 - l

As b2 - 4ac > 0, [-(2l + 1)]2 - (4)(1)(l2 - l) > 0

Which gives 8l + 1 > 0

As h is an integer, 8l + 1 is a square number. 

Therefore 8l + 1  = x2 

The values of l that satisfy the equation are 1, 3, 6, 10, etc.   

Alternative approaches

In a workshop for teacher trainees at London Metropolitan University (January 2018), Tom Mee and Eduardo Abend took a novel approach that moved from the general to the particular. Taking their starting point as l2 + h2 = l(h +1) + h(l +1), they derived (l - h)2 = l + h and deduced that l + h must be a square number. From this they were able to set up simultaneous equations to find values for l and h that satisfied the condition in the prompt. For example, when l + h = 25, l - h = 5 and l = 16, h = 9. You can see their initial responses to the prompt here and their subsequent reasoning here.

Tom and Eduardo presented their reasoning to the rest of the teacher trainees.

Mixed Attainment Maths 

At the Mixed Attainment Maths conference at Sheffield Hallam university (June 2017), one participant of the Inquiry Maths workshop graphed the following equations:

l + h + 2hl = 45 and l2 + h2 = 45

She was able to show the solutions of l = 6, h = 3 and l = 3, h = 6 at the intersections of the circle and curve.

Early professional development

At an Early Professional Development Day (June 2014), maths teachers in their first and second years of teaching in Brighton and Hove (UK) looked at the formulae prompt. Alice-Rae Gilbert (from Dorothy Stringer secondary school) noticed a link between the length of the longest side of the array and the total number of matchsticks, which she shows is always a triangular number. Alice presents her full working here.



Ranelagh Maths Network's critical reflection on this prompt during an Inquiry Maths session in November 2013 was invaluable for the development of the inquiry. The group of maths teachers from Bracknell Forest, Reading and the Royal Borough of Windsor and Maidenhead (UK) meet for professional development activities over the school year in order to keep up to date with developments to the curriculum, assessment and pedagogy. Their organiser is Yvonne Scott from Ranelagh School, Bracknell.