Okay this is a sequence that has everything; it's got mystery, it's got a simple definition,
great music - it's called the Inventory Sequence and it was invented by a guy called Joseph
Rozhenko and it goes like this. We're gonna build up a sequence, every so often we will
pause and take an inventory of it and repeat. I'm going to start off: here's what we have so far,
blank paper. And I ask you, how many 0s can you see? Zero. So we write down, we have zero 0s. And
when we see a 0 we have to take stock again, we take a new inventory because we're missing
something, okay. Okay so now we say, Brady, how many 0s do we see? Huh? I can see one. So we have
one 0. Brady how many 1s can I see? Well I can see one 1 so we have one 1. How many 2s can I see?
Zero 2s. Okay when we get to a 0 we have to take inventory again: how many 0s do we see? Two 0s. How
many 1s do we see? Two. How many 2s do we see? Well we didn't have any but now we have two 2s so we
have two 2s. And how many 3s do we see? Well I don't see any 3s, we have zero 3s. Time to take stock, we
got to a 0. How many 0s do we see? One, two, three - three 0s. How many 1s? One, two. And how many 2s do
we have? Well we have one, two, three, four 2s. - (Brady: Oh so the inventory is taking stock as it grows as well?)
Yes..that's what makes it interesting. And then we keep going; how many 3s do we have? Well I can see one 3
so we have one 3. How many 4s? Well there's a 4 so we have one 4. How many 5s? Zero 5s. We get to
a 0: time to take stock. How many 0s do we have? One, two, three, four. How many 1s? One, two, three, four. How
many 2s? One, two, three, four 2s. How many 3s? I can only see one, so one 3. How many 4s? Well there was
one there, but we now have three more so we have four 4s. And how many 5s? None. And that's how it
goes; the next line it always starts with n because we will- each row gives us a zero. Now we have one,
two, three, four, five 0s. So the first entry of each row is 0, 1, 2, 3, 4, 5, 6 and so
on and the number of 1s and 2s and 3s grows in a rather irregular way. And if you were to look at a
plot you can see they're in groups and the groups correspond to the rows, the chunks, of the sequence
that we're building up and it always starts with- the nth chunk begins with n and then well it goes
up and down. The sequence we're looking at is not just- it's the concatenation - the stringing together
of all the chunks. This whole thing is the sequence and what we're drawing actually is a pin plot
officially. So there's one other sequence I've seen in the past this was Jan Ritsema van Eck sequence that
I did a video for you about, the van Eck's- the famous van Eck sequence. And I told van Eck about this
and he made a plot of the first thousand terms which was very interesting, quite hopeful. Here's
his graph - he went out to a thousand terms. His plot just joined successive terms, it's
not a pin plot like the first one but it looks like this. - (And we always see it plunge down to)
(0 for those inventory moments?) - When it comes down to 0, precisely so yes. And he noticed
that if you look at the upper- the envelope of these points, it's about square root of 2n.
In fact the this is- it's a famous sequence. It's the sequence that goes 1, 1, 2, 2, 2, 3,
3, 3, 3, 4, 4, 4, 4, 4 where each number- 1 appears twice, 2 appears
three times, 3 appears four times, 4 appears five times; n appears n+1 times. It's- it- and
it grows like very like square root of 2n. And that's what he's drawn in brown here, and you
can see it gives you a very good idea of how fast these things are growing for the first
thousand terms. And then he did a bigger plot, ten thousand terms, and the brown line is useless, it
grows much faster. - (So it's not doing square root of 2n anymore?) - It's not going square root of
2n, it's way bigger than square root of 2n. - (It just seems to suddenly leap and then leap again)
(like it doesn't- it's odd.) - It's a real odd one, it's very irregular and wonderful. So- and each clump
is a a kind of development of the previous chunk. I would like to play it for you. You know,
any of the sequences in the OEIS, you click listen and you can hear them. I'm going to
play that one on the grand piano for you. - (Or on a Mac!) - Or on a Mac using GarageBand, yes.
As it's going along we're seeing the chunks which are the rows of the table.
And each chunk begins with a higher and higher- one higher note than the previous chunk, but then
they're rather irregular. And if you look at the picture of the- of the plot of the sequence that
garage band is actually playing you can see it's divided up into chunks and the chu- each
chunk is a little bit like the previous chunk but keeps changing and they also get longer
each time. So I think of this as variations on a theme like Beethoven's Diabelli variations
where he was- Diabelli proposed the theme and Beethoven embroidered it, produced a series of
variations on it. Here we have the variations but we don't know what the theme is.
And you can hear when it gets to the end of a chunk, there's a string of low numbers
like the 0s and 1s at the end of that and you can hear them down at the bottom of the
keyboard and then it starts up again. So there's a well-defined notion of chunk
of variations you could say - except we don't know the theme.
You can see it's getting more interesting as it goes along, there's more variation and you
can see it graphically. The sequence gets more and more complicated as you study it and really
in the end we don't know that much about it. Rémy Sigrist made a plot of the first 10 to
the 8th terms - 100 million terms - and there's a very interesting structure. This is the same
sequence, it's just represented by dots; each term is now a dot on the piece of paper. And you can
see something very strange is happening, this is a 100 million terms and we're going along
and the points sort of fall on lines but the lines cross each other. This is very unusual in this kind
of sequence. Normally the lines get further and further apart as we go along; what's happening here
is the lead is changing. Sometimes there'll be more 8s than anything else, the 8s will dominate,
but then after a while the 9s will take over, there'll be more 9s than 8s. And then maybe
after a while the 8s take over again and that's why these lines are crossing. And really
this is a really mysterious sequence, it would be nice to know more about it. - (Do you think there's)
(any value to mathematics in here? I mean this is a recreational sequence, isn't it, and you've found a)
(a quirky thing but do you sometimes think there's some hidden meaning or depth or importance to this?)
There could be. Maybe not, maybe so. You know, one of the things that John Conway did was to take
what you might say small problems like this and make theories out of them and
connect them with other things; and I think that's a very good thing to do.
So maybe in itself it's just a sequence, but who knows where it will lead.
Now here's a great sequence for you to grapple with courtesy of today's episode sponsor Jane Street.
We've got an infinite pathway with numbered stones but each stone also has a
number like this: we've got 1, 1, 2, 2, 3, 3, 4, 4 - you get the picture.
The red numbers indicate the size of the leap you can make from each stone, either forward or back.
Can't be more or less, that's the exact size. So how many leaps does it take to reach each
stone on the pathway? For example if you want to reach this stone, well that's going to take five
leaps as you can see. As you aim for stones further down the path some very interesting patterns and
problems emerge. Check out this page on the Jane Street website to dig deeper. While you're there,
if you've got a brain for problems and numbers and stuff like this, you may be the sort of person to
join Jane Street's genius teams around the world. They've got offices in Hong Kong, New York, London;
check out details on their website. There'll be links in the video description and have some fun
with this infinite pathway. - Well it was a choice, we could put the 6 here...no no I can't put it there
because that's got neighbor 5, 4 and 1. I could only put a 10 there aha. You've got to put
them in order, yes. You've got to build your way up. - So it's not what's the highest value can I get on
the board, it's what's the highest value I can get on the board building in order. - Building in order