# Sequences through Programming

Whenever I teach the nth term of linear sequences through programming I find students have little difficulty calculating the formula but often forget how to do it in later lessons. I think this is because they don’t fully appreciate what n and therefore the nth term is used to represent. Maybe they take the n in ‘nth term’ to be just another letter we use in maths without it having any real meaning. Because of this I wanted to find a way of really embedding what n represents.

A few years ago we used to do coursework in maths and whilst it is no longer a requirement at GCSE the tasks themselves were really enjoyable and mathematically rich. Hidden faces is one of my favourite coursework tasks as it brings together multiple strands of maths: isometric drawing, volume, area, perimeter, sequences, equations and proof.

### Sequences through Programming Project

I decided to attempt a project with my Year 9 class that would span over 5 lessons and a couple of homeworks. They would begin by drawing a sequence of diagrams on isometric paper, find the nth term of each sequence, use algebra to prove they were correct then write a basic computer programme to model the sequence.

The real challenge would come when they had to complete the process again but this time using a sequence of their own design. Finally, once they had written a programme to model their own pattern their friends would recreate the sequence using the computerised model.

### Drawing an Isometric Pattern

To begin the project we all followed the same pattern. The same one that is given in the old coursework piece. To differentiate for those who struggled drawing in 3D we used multilink cubes so they could build the shapes.

To help me draw the shapes I simply presented an isometric dotty grid on the interactive whiteboard and drew in the shapes freehand.

### Tabulating the results

The students quickly discovered it was difficult to spot a pattern from the annotated diagrams. We decided to tabulate the number of cubes, total, seen and hidden faces to help elicit any obvious patterns.

By not completing the table the class were able to predict and test their pattern for the fourth, fifth and sixth diagrams.

### Finding the nth terms

Before we moved on to finding the nth term of each sequence it was really important to consolidate their understanding of what n represented. I’m not sure this is mathematically correct but I like to say the nth term represents the ‘n’ in any term. I really pronounce the ‘n’ part of any. As expected a number of students had forgotten how to find the nth term of a linear sequence despite being very competent at it no less than 48 hours previously. After a quick recap the class were able to generate the nth terms for the total, seen and hidden faces.

### Proving the formulae

I wanted the kids to really understand the nth terms not as meaningless formulae calculated for the sake of it but as real numbers in their generalised form. I asked the class to look for a pattern in the table of results that would connect the three different faces together. After a short while most students had realised the Total faces is the sum of the hidden and seen or in algebra form T = H + S. This was easy to demonstrate using numbers from the diagrams, i.e., with 4 cubes there were 24 total, 10 hidden and 14 seen, 24 = 10 + 14. Using algebra we could check our formulae shared the same relationship. 6n = 3n -2 + 3n + 2.

### Writing the computer programme.

The main point of this project was to embed the concept of the nth term as a formula for calculating a given number of faces when the number of cubes is known. Learning how to write a computer programme to model this really consolidates n as the variable.

Students were each given a TI-nSpire CX Graphical calculator. I used the teacher’s software with the interactive whiteboard.

Here’s the programme the class and I wrote to model our sequences.

Once the programme was written, syntax checked, stored and saved the students were given time to run it for any number of cubes.

Here’s an example of running the programme with 120 cubes.

### Drawing the sequence from the computerised model

After two lessons and one homework we had concluded the main teaching phase of the project. The next phase challenged the students to complete the process again but this time based on their own isometric patterns which were designed as homework. The following lessons were used for the class to find and prove the nth terms for their own design and again write a programme using the formulae to model the faces. Once all the unique programmes were written the students were put in pairs. Using the programme written on the TI-nSpire calculators the students could find the number of total, seen and hidden faces. From this information they were challenged to recreate their partner’s sequence of drawings on isometric paper. At the end the students peer assessed each other’s work.

Have you ever used programming in maths? How about Logo or Geogebra lessons? Comments to share ideas are very welcome.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

### Mr Mathematics Blog

#### Angles in Polygons

There are two key learning points when solving problems with angles in polygons.  The first is to understand why all the exterior angles of a polygon have a sum of 360°.  The second is to understand the interior and exterior angles appear on the same straight line. Students can be told these two facts and […]

#### Getting Ready for a New School Year

When getting ready for a new school year I have a list of priorities to work through. Knowing my team have all the information and resources they need to teach their students gives me confidence we will start the term in the best possible way.  Mathematics Teaching and Learning Folder All teachers receive a folder […]

#### Mathematics OFSTED Inspection – The Deep Dive

Earlier this week, my school took part in a trial OFSTED inspection as part of getting ready for the new inspection framework in September 2019. This involved three Lead Inspectors visiting our school over the course of two days. The first day involved a ‘deep dive’ by each of the Lead Inspectors into Mathematics, English […]