You are currently browsing the tag archive for the ‘sequences’ tag.


The Van Eck Sequence

This is a nice sequence as discussed in the Numberphile video above.  There are only 2 rules:

  1. If you have not seen the number in the sequence before, add a 0 to the sequence.
  2. If you have seen the number in the sequence before, count how long since you last saw it.

You start with a 0.


You have never seen a 0 before, so the next number is 0.


You have seen a 0 before, and it was 1 step ago, so the next number is 1.


You have never seen a 1 before, so the next number is 0.


You have seen a 0 before, it was 2 steps ago, so the next number is 2.



I can run a quick Python program (adapted from the entry in the Online Encyclopedia of Integer Sequences here) to find the first 100 terms.

A181391 = [0, 0]
for n in range(1, 10**2):
 for m in range(n-1, -1, -1):
  if A181391[m] == A181391[n]:

This returns:

[0, 0, 1, 0, 2, 0, 2, 2, 1, 6, 0, 5, 0, 2, 6, 5, 4, 0, 5, 3, 0, 3, 2, 9, 0, 4, 9, 3, 6, 14, 0, 6, 3, 5, 15, 0, 5, 3, 5, 2, 17, 0, 6, 11, 0, 3, 8, 0, 3, 3, 1, 42, 0, 5, 15, 20, 0, 4, 32, 0, 3, 11, 18, 0, 4, 7, 0, 3, 7, 3, 2, 31, 0, 6, 31, 3, 6, 3, 2, 8, 33, 0, 9, 56, 0, 3, 8, 7, 19, 0, 5, 37, 0, 3, 8, 8, 1, 46, 0, 6, 23]

I then assigned each term an x coordinate value, i.e.:

0 , 0
1 , 0
2 , 1
3 , 0
4 , 2
5 , 0
6 , 2
7 , 2
8 , 1
9 , 6
10 , 0
11 , 5
12 , 0
13 , 2
14 , 6
15 , 5
16 , 4
17 , 0
18 , 5
19 , 3
20 , 0


This means that you can then plot the sequence as a line graph, with the y values corresponding to the sequence terms.  As you can see, every time we hit a new peak the following value is 0, leading to the peaks and troughs seen below:

Let’s extend the sequence to the first 1000 terms:


We can see that the line y = x provides a reasonably good upper bound for this data:



But it is not known if every number would actually appear in the sequence somewhere – so this bound may not hold for larger values.

Length of steps before new numbers appear.

We can also investigate how long we have to wait to see each number for the first time by running the following Python code:

A181391 = [0, 0]
for n in range(1, 10**3):
 for m in range(n-1, -1, -1):
  if A181391[m] == A181391[n]:

  for m in range(1,50):
   if A181391[n]==m:
    print(m, ",", n+1)

This returns the following data:

1 , 3
2 , 5
6 , 10
5 , 12
4 , 17
3 , 20
9 , 24
14 , 30
15 , 35
17 , 41
11 , 44
8 , 47
42 , 52
20 , 56
32 , 59
18 , 63
7 , 66
31 , 72
33 , 81
19 , 89


The first coordinate tells us the number we are interested in, and the second number tells us how long we have to wait in the sequence until it appears.  So (1 , 3) means that we have to wait until 3 terms in the sequence to see the number 1 for the first time.

Plotting this for numbers 1-50 on a graph returns the following:

So, we can see (for example that we wait 66 terms to first see a 7, and 173 terms to first see a 12.  There seems to be a general trend that as the numbers get larger we have to wait longer to see them.  Testing this with a linear regression we can see a weak to moderate correlation:


Checking for the numbers up to 300 we get the following:

For example this shows that we have to wait 9700 terms until we see the number 254 for the first time.  Testing this with a linear correlation we have a weaker positive correlation than previously.

So, a nice and quick investigation using a combination of sequences, coding, graphing and regression, with lots of areas this could be developed further.


Sequence Investigation

This is a nice investigation idea from Nrich.  The above screen capture is from their Picture Story puzzle.  We have successive cubes – a 1x1x1 cube, a 2x2x2 cube etc.

The cubes are then rearranged to give the following shape.  The puzzle is then to use this information to discover a mathematical relationship.  This was my first attempt at this:

13 = 12
23 = (1+2)2 – 12
33 = (1+2+3)2 – (1+2)2
43 = (1+2+3+4)2 – (1+2+3)2

n3 = (1+2+3+4+…+n)2 – (1+2+3+…+ (n-1))2

This is not an especially attractive relationship – but nevertheless we have discovered a mathematical relationship using the geometrical figures above. Next let’s see why the RHS is the same as the LHS.


(1+2+3+4+…+n)2 – (1+2+3+…+ (n-1))2

= ([1+2+3+4+…+ (n-1)] + n)2 – (1+2+3+…+ (n-1))2

= (1+2+3+…+ (n-1))2 + n2 + 2n(1+2+3+4+…+ (n-1)) – (1+2+3+…+ (n-1))2

= n2 + 2n(1+2+3+4+…+ (n-1))

next we notice that 1+2+3+4+…+ (n-1) is the sum of an arithmetic sequence first term 1, common difference 1 so we have:

1+2+3+4+…+ (n-1) = (n-1)/2 (1 + (n-1) )

1+2+3+4+…+ (n-1) = (n-1)/2 + (n-1)2/2

1+2+3+4+…+ (n-1) = (n-1)/2 + (n2 – 2n + 1)/2


2n(1+2+3+4+…+ (n-1)) = 2n ( (n-1)/2 + (n2 – 2n + 1)/2 )

2n(1+2+3+4+…+ (n-1)) = n2 -n + n3 – 2n2 + n


n2 + 2n(1+2+3+4+…+ (n-1)) = n2 + n2 -n + n3 – 2n2 + n
n2 + 2n(1+2+3+4+…+ (n-1)) = n3

and we have shown that the RHS does indeed simplify to the LHS – as we would expect.

An alternative relationship

13 = 12
13+23 = (1+2)2
13+23+33  = (1+2+3)2
13+23+33+…n3  = (1+2+3+…+n)2

This looks a bit nicer – and this is a well known relationship between cubes and squares.  Could we prove this using induction?  Well we can show it’s true for n =1.  Then we can assume true for n=k:

13+23+33+…k3  = (1+2+3+…+k)2

Then we want to show true for n = k+1


13+23+33+… k3  + (k+1)3= (1+2+3+…+k + (k+1))2


13+23+33+… k3  + (k+1)3

= (1+2+3+…+k)2 + (k+1)3


(1+2+3+…+k + (k+1))2

= ([1+2+3+…+k] + (k+1) )2

= [1+2+3+…+k]2 + (k+1)2 + 2(k+1)[1+2+3+…+k]

= [1+2+3+…+k]+ (k+1)2 + 2(k+1)(k/2 (1+k))   (sum of a geometric formula)

= [1+2+3+…+k]+ (k+1)2 + 2(k+1)(k/2 (1+k))

= [1+2+3+…+k] + k3+ 3k2 + 3k + 1

= (1+2+3+…+k)2 + (k+1)3

Therefore we have shown that the LHS = RHS and using our induction steps have shown it’s true for all n.  (Write this more formally for a real proof question in IB!)

So there we go – a couple of different mathematical relationships derived from a simple geometric pattern – and been able to prove the second one (the first one would proceed in a similar manner).  This sort of free-style pattern investigation where you see what maths you can find in a pattern could make an interesting maths IA topic.

Essential resources for IB students:

1) Revision Village

Screen Shot 2021-05-19 at 9.55.51 AM

Revision Village has been put together to help IB students with topic revision both for during the course and for the end of Year 12 school exams and Year 13 final exams.  I would strongly recommend students use this as a resource during the course (not just for final revision in Y13!) There are specific resources for HL and SL students for both Analysis and Applications.

Screen Shot 2018-03-19 at 4.42.05 PM.png

There is a comprehensive Questionbank takes you to a breakdown of each main subject area (e.g. Algebra, Calculus etc) and then provides a large bank of graded questions.  What I like about this is that you are given a difficulty rating, as well as a mark scheme and also a worked video tutorial.  Really useful!

Screen Shot 2021-05-19 at 10.05.18 AM

The Practice Exams section takes you to a large number of ready made quizzes, exams and predicted papers.   These all have worked solutions and allow you to focus on specific topics or start general revision.  This also has some excellent challenging questions for those students aiming for 6s and 7s.

Each course also has a dedicated video tutorial section which provides 5-15 minute tutorial videos on every single syllabus part – handily sorted into topic categories.

2) Exploration Guides and Paper 3 Resources

Screen Shot 2021-05-19 at 6.32.13 PM

I’ve put together four comprehensive pdf guides to help students prepare for their exploration coursework and Paper 3 investigations. The exploration guides talk through the marking criteria, common student mistakes, excellent ideas for explorations, technology advice, modeling methods and a variety of statistical techniques with detailed explanations. I’ve also made 17 full investigation questions which are also excellent starting points for explorations.  The Exploration Guides can be downloaded here and the Paper 3 Questions can be downloaded here.


The Telephone Numbers – Graph Theory

The telephone numbers are the following sequence:

1, 1, 2, 4, 10, 26, 76, 232, 764, 2620, 9496…

(where we start from n=0).

This pattern describes the total number of ways which a telephone exchange with n telephones can place a connection between pairs of people.

To illustrate this idea, the graph below is for n=4.  This is when we have 10 telephones:


Each red line represents a connection.  So the first diagram is for when we have no connections (this is counted in our sequence).  The next five diagrams all show a single connection between a pair of phones.  The last three diagrams show how we could have 2 pairs of telephones connected at the same time.  Therefore the 4th telephone number is 10.   These numbers get very large, very quickly.

Finding a recursive formula

The formula is given by the recursive relationship:

T(n) = T(n-1) + (n-1)T(n-2)

This means that to find (say) the 5th telephone number we do the following:

T(5) = T(5-1) + (5-1)T(5-2)

T(5) = T(4) + (4)T(3)

T(5) = 10 + (4)4

T(5) = 26

This is a quick way to work out the next term, as long as we have already calculated the previous terms.

Finding an nth term formula

The telephone numbers can be calculated using the nth term formula:



 This is going to be pretty hard to derive!  I suppose the first step would start by working out the total number of connections possible between n phones – and this will be the the same as the graphs below:


These clearly follow the same pattern as the triangular numbers which is 0.5(n² +n) when we start with n = 1.  We can also think of this as n choose 2 – because this gives us all the ways of linking 2 telephones from n possibilities.  Therefore n choose 2 also generates the triangular numbers.

But then you would have to work out all the permutations which were allowed – not easy!

Anyway, as an example of how to use the formula to calculate the telephone numbers, say we wanted to find the 5th number:

We have n = 5.  The summation will be from k = 0 and k = 2 (as 5/2 is not an integer).

Therefore T(5) = 5!/(20(5-0)!0!) + 5!/(21(5-2)!1!) + 5!/(22(5-4)!2!)

T(5) = 1 + 10 + 15 = 26.

Finding telephone numbers through calculus

Interestingly we can also find the telephone numbers by using the function:

y = e0.5x2+x

 and the nth telephone number (starting from n = 1)  is given by the nth derivative when x = 0.

For example,


So when x = 0, the third derivative is 4.  Therefore the 3rd telephone number is 4.

The fifth derivative of the function is:


So, when x =0 the fifth derivative is 26.  Therefore the 5th telephone number is 26.

If you liked this post you might also like:

Fermat’s Theorem on the Sum of two Squares – A lesser known theorem from Fermat – but an excellent introduction to the idea of proof.

Unbelievable: 1+2+3+4…. = -1/12 ? A result that at first glance looks ridiculous – and yet can be shown to be correct.  How?

IB Revision

Screen Shot 2018-03-19 at 4.35.19 PM

If you’re already thinking about your coursework then it’s probably also time to start planning some revision, either for the end of Year 12 school exams or Year 13 final exams. There’s a really great website that I would strongly recommend students use – you choose your subject (HL/SL/Studies if your exam is in 2020 or Applications/Analysis if your exam is in 2021), and then have the following resources:

Screen Shot 2018-03-19 at 4.42.05 PM.pngThe Questionbank takes you to a breakdown of each main subject area (e.g. Algebra, Calculus etc) and each area then has a number of graded questions. What I like about this is that you are given a difficulty rating, as well as a mark scheme and also a worked video tutorial.  Really useful!

Screen Shot 2019-07-27 at 10.02.40 AM

The Practice Exams section takes you to ready made exams on each topic – again with worked solutions.  This also has some harder exams for those students aiming for 6s and 7s and the Past IB Exams section takes you to full video worked solutions to every question on every past paper – and you can also get a prediction exam for the upcoming year.

I would really recommend everyone making use of this – there is a mixture of a lot of free content as well as premium content so have a look and see what you think.


This is another interesting maths sequence puzzle:

When x = 1, y = 1, when x= 2, y = -1, when x = 3, y = 1,

a) if when x = 4, y = -1, what formula gives the nth term? 

b) if when x = 4, y = 3, what formula gives the nth term?

Answer below in white text (highlight to see)

a) This is a nice puzzle when studying periodic graphs. Hopefully it should be clear that this is a periodic function – and so can be modelled with either sine or cosine graphs.

One possibility would be cos((n-1)pi)

b) This fits well when studying the absolute function – and transformations of graphs. Plotting the first 3 points, we can see they fit a transformed absolute value function – stretched by a factor of 2, and translated by (2,-1). So the function 2abs(x-2) -1 fits the points given.



This is a really nice puzzle we looked at at the IB HL workshop:

When x = 1, y = 1, when x = 2, y = 2, when x = 3, y = 3 but when x = 4, y does not equal 4. Find a sequence which describes these points.

There are an infinite number of answers, though not necessarily easy to find!

If you are interested in the solutions, the answer is written below in white text, highlight to reveal!


Two possible ways of tackling the problem –

1) as a polynomial – if y = (x-1)(x-2)(x-3) + x this satisfies the original question – as the brackets all cancel to zero for 1,2,3 but will remain for x = 4 onwards.

2) modelling as a function with absolute value. Notice that -(abs x ) will satisfy the correct shape – ie a linear increase and then divergence from this. By transformations therefore we can get -(abs(x-3) ) +3. This fits the graph for y=x for 1,2,3 before altering for y=4.

Website Stats


IB Maths Resources by Andrew Chambers

All content on this site has been written by Andrew Chambers (MSc. Mathematics, IB Mathematics Examiner). Please contact here for information on webinar training or for business ideas.

IB Maths Exploration Guide

IB Maths Exploration Guide

A comprehensive 63 page pdf guide to help you get excellent marks on your maths investigation. Includes:

  1. Investigation essentials,
  2. Marking criteria guidance,
  3. 70 hand picked interesting topics
  4. Useful websites for use in the exploration,
  5. A student checklist for top marks
  6. Avoiding common student mistakes
  7. A selection of detailed exploration ideas
  8. Advice on using Geogebra, Desmos and Tracker.

Available to download here.

IB HL Paper 3 Practice Questions (120 page pdf)

IB HL Paper 3 Practice Questions 

Seventeen full investigation questions – each one designed to last around 1 hour, and totaling around 40 pages and 600 marks worth of content.  There is also a fully typed up mark scheme.  Together this is around 120 pages of content.

Available to download here.

Modelling Guide

IB Exploration Modelling Guide 

A 50 page pdf guide full of advice to help with modelling explorations – focusing in on non-calculator methods in order to show good understanding.

Modelling Guide includes:

Linear regression and log linearization, quadratic regression and cubic regression, exponential and trigonometric regression, comprehensive technology guide for using Desmos and Tracker.

Available to download here.

Statistics Guide

IB Exploration Statistics Guide

A 55 page pdf guide full of advice to help with modelling explorations – focusing in on non-calculator methods in order to show good understanding.

Statistics Guide includes: Pearson’s Product investigation, Chi Squared investigation, Binomial distribution investigation, t-test investigation, sampling techniques, normal distribution investigation and how to effectively use Desmos to represent data.

Available to download here.

IB Revision Notes

IB Revision Notes

Full revision notes for SL Analysis (60 pages), HL Analysis (112 pages) and SL Applications (53 pages).  Beautifully written by an experienced IB Mathematics teacher, and of an exceptionally high quality.  Fully updated for the new syllabus.  A must for all Analysis and Applications students!

Available to download here.

Recent Posts

Follow IB Maths Resources from British International School Phuket on