What's the explicit formula {$a_n$} for the Stanley Sequence beginning $a_0=0$, and $a_1=1$.

67 Views Asked by At

A Stanley sequence is a sequence of non-negative integers. In this case, the initial term is 0, and the next is 1. Every following term is the smallest integer bigger than the last term such that no three (not necessarily consecutive) terms form an arithmetic system.

The first few terms are as follows: 0, 1, 3, 4, 9, 10, 12, 13

It is easy to see that this sequence consists of all integers that do not have a '2' in their representation in base 3.

How can I write a formula for {$a_n$} based on that information? I'm researching sequences produced by the greedy algorithm and wondered how can I mathematically explain the former conclusion.

Another interesting question is why exactly do these numbers happen to be the terms of the sequence. One possible approach is to notice that the only way to have a two in ternary (by multiplication with 2) is to multiply a 1. Then we can examine what number is needed to prevent this and after a thorough case by case analysis, it leads to a not so beautiful proof. Does someone have a better suggestion as I was not able to find any in the papers I've read...

Thank you in advance!