In previous blogs, we’ve looked at some interesting integer sequences. We started with the Fibonacci sequence, then the “Look-and-say” sequence and most recently Golomb’s sequence. Today, it’s Van Eck’s sequence.
The sequence was first published to the Online Encyclopedia of Integer Sequences (OEIS) in 2010 by a hobby mathematician called Jan Ritsema van Eck. It’s a very simple concept, which makes you wonder how it took so long for someone to think it up, and it is a very mysterious sequence.
How to generate the sequence
The sequence starts with 0.
For each following term, if the previous term has not appeared in the sequence before the next term will be 0. However, if the previous term has appeared in the sequence before, the next term will be the number of terms ago that number appeared. Make any sense? Probably not, but it will once I show you the first few terms of the sequence (I promise).
So, as we said, the first term is 0.
Now the second term. The previous term, 0, hasn’t appeared before in the sequence (obviously, it was the first term) so the second term is 0.
Now the third term. The previous term, 0, has appeared before.

It appeared one term ago so the third term will be 1.
The fourth term. The previous term, 1, has not appeared before. So it will be 0.
The fifth term. The previous term, 0, has appeared before.

The last time 0 appeared was 2 terms ago, so the fifth term is 2.
Hopefully it’s making more sense now… let’s do a few more terms.
The sixth term. The previous term, 2, has not appeared before. So it will be 0.
The seventh term. The previous term, 0, has appeared before.

The last time 0 appeared was 2 terms ago, so the seventh term is 2.
The eighth term. The previous term, 2, has appeared before.

The last time 2 appeared was 2 terms ago, so the eighth term is also 2.
The ninth term. The previous term, 2, has appeared before.

The last time 2 appeared was 1 term ago, so the ninth term is 1.
Now it gets a little bit more interesting…
The tenth term. The previous term, 1, has appeared before.

As you can see, it appeared 6 terms ago. So the tenth term is 6.
Here are the first 25 terms of van Eck’s sequence:
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
A few interesting facts about the sequence
It has been proven that there are infinitely many 0s in the sequence. This means that the sequence keeps producing new numbers forever (if you are interested in the proof then you can watch Numberphile’s video with Neil Sloane here). However it is not known whether every number will appear in the sequence.
The same number cannot appear more than twice consecutively. This makes sense as when the same number appears twice consecutively, the next term must be 1 (as the previous term appeared in the term before the previous term).
It is interesting how some numbers take a long time to first appear in the sequence. You would expect that the smaller the number is the sooner it appears in the sequence, but that’s not always true. For example, the first time the number 7 appears in the sequence is the 66th term, after the number 42 has already appeared! Completely random and there is no reason for it, that’s one of the quirks about this sequence which makes it so interesting.
Here is the breakdown of how many times each number appears in the first 100 terms. As you would expect, the number 0 appears most often. But strangely, the number 1 only appears 4 times and the number 2 only 8. But the number 3 appears 15 times… again, no particular reason, completely random seemingly. The largest number to appear in the first 100 terms is 56.
| Number | Frequency |
| 0 | 25 |
| 1 | 4 |
| 2 | 8 |
| 3 | 15 |
| 4 | 4 |
| 5 | 8 |
| 6 | 8 |
| 7 | 3 |
| 8 | 5 |
| 9 | 3 |
| 11 | 2 |
| 14 | 1 |
| 15 | 2 |
| 17 | 1 |
| 18 | 1 |
| 19 | 1 |
| 20 | 1 |
| 31 | 2 |
| 32 | 1 |
| 33 | 1 |
| 37 | 1 |
| 42 | 1 |
| 46 | 1 |
| 56 | 1 |
Here is a graph showing the first 10,000 terms in the sequence. As you would expect, the sequence jumps up and down. And you can see that the sequence grows gradually. You can also see that the maximum number the sequence reaches in the first 10,000 terms is 705 (this is the 981st term).

And here I have graphed the maximum value the sequence has produced so far, also for the first 10,000 terms. This graph roughly follows a straight line with gradient close to 1 (0.8694 to be exact).

If you’re interested in knowing how to code this sequence in Excel as I did to produce the above two graphs, send an email to sam@metatutor.co.uk and I can send you my workings.
Obviously this sequence is not examinable at any level of mathematics, this is just for fun. If you are in Bristol and you or your son/daughter is struggling with any aspect of mathematics, book a free taster session.
Click here to read testimonials from some of our clients (and here for Google reviews).
Click here to access our free worksheets.

Van Eck’s sequence is a fascinating mathematical concept that showcases the unpredictability of patterns. This sequence has applications in various fields such as cryptography and computer science. Exploring such unique sequences can broaden our understanding of mathematics and its practical applications.
Regenerate response