van eck's sequence

the rule is one line. nobody knows what it does.

the rule

start with a(0) = 0. for each next term: if the previous value has never appeared before, write 0. otherwise write how many steps back you have to go to find it again.

that's it. two sentences. and yet the sequence has no known closed form, no proven density, and it keeps doing things people can't explain.

the first terms

the picture

each column is a term. height is the value (log-ish scale). zeros show as the bottom row. the bright bands are places where a value repeats a lot.

run it yourself

how far back to the previous occurrence of a value?

why it's interesting

the first few hundred terms look random. then it settles into long stretches where the same value repeats, broken by sudden jumps to large numbers. it's not periodic. it's not random. it's just defined, and that turns out to be enough to be weird.

similar in spirit to collatz: a rule simple enough to state on a napkin, behaviour nobody can pin down.