TOPICS
Search

Stanley Sequence


A Stanley sequence is a sequence of nonnegative integers obtained by starting with a nonempty finite increasing seed containing no nonconstant three-term arithmetic progression, then repeatedly adjoining the least integer greater than the previous term that creates no nonconstant three-term arithmetic progression (Odlyzko and Stanley 1978).

For the seed 0, 1, the terms are 0, 1, 3, 4, 9, 10, 12, 13, ... (OEIS A005836). They are precisely the nonnegative integers whose ternary expansions use only 0 and 1. The seed 0, 4 instead gives 0, 4, 5, 7, 11, 12, 16, 23, 26, ... (OEIS A005487). Different seeds can produce very different structures, and questions about their growth remain open (Erdős et al. 1999, Moy and Rolnick 2016).

Questions about explicit descriptions and growth for seeds 0, n form problem 271 in the Erdős problems collection (Bloom 2026).


See also

Arithmetic Progression, Erdős Problems, Greedy Algorithm

Explore with Wolfram|Alpha

References

Bloom, T. F. "Erdős Problem 271." Accessed Oct. 26, 2026. https://www.erdosproblems.com/271.Erdős, P.; Lev, V.; Rauzy, G.; Sándor, C.; and Sárközy, A. "Greedy Algorithm, Arithmetic Progressions, Subset Sums and Divisibility." Disc. Math. 200, 119-135, 1999. https://doi.org/10.1016/S0012-365X(98)00385-9.Moy, R. A. and Rolnick, D. "Novel Structures in Stanley Sequences." Disc. Math. 339, 689-698, 2016. https://doi.org/10.1016/j.disc.2015.10.017.Odlyzko, A. M. and Stanley, R. P. "Some Curious Sequences Constructed with the Greedy Algorithm." Bell Laboratories memorandum, Jan. 1978. https://math.mit.edu/~rstan/papers/od.pdf.Sloane, N. J. A. Sequences A005836 and A005487in "The On-Line Encyclopedia of Integer Sequences."

Cite this as:

Weisstein, Eric W. "Stanley Sequence." From MathWorld--A Wolfram Resource. https://mathworld.wolfram.com/StanleySequence.html

Subject classifications