The Look-and-Say Sequence: Terms in Output-Linear Time and Digits in O(n) Steps

Let a(n) be the n-th term of the look-and-say sequence (A005150), a(1)=1, a(n+1)=D(a(n)), where D writes the length of every run of equal digits followed by the digit, and let |a(n)| ~ 1.567 * lambda^n be its number of digits, lambda=1.3036 (A005341). Every term is a concatenation of strings from a set A of 99 strings, the 92 Conway elements and 7 transient words, and A is generated by a cut test and verified by a finite closure check that proves a(t+1) is the product of x over w_t for the word w_t = sigma^t(1). This gives three exact algorithms: the whole term a(n) in |a(n)|(1+o(1)) bytes of memory copy plus O(lambda^(n/2)) other operations, which is optimal because the output has that size; any digit or block of a(n) in O(n) steps on big integers, without building the term; and the length |a(n)| and the numbers of digits 1,2,3 in a(n) from linear recurrences of order at most 79 (order 72 for the length), proved by a finite residual check. All claims are proved. In Python, a(68) with 105,745,224 digits takes 0.05 s, 48 times less than stepwise expansion over Conway elements; |a(10^5)| takes 0.99 s and |a(10^6)| takes 36.9 s; a digit of a(3000) at position 10^300 is read in 0.96 ms. The OEIS table of A005150 stops at n=25.

Authors

Publication Details

Journal
Zenodo (CERN European Organization for Nuclear Research)
Published
2026-11-10
DOI
https://doi.org/10.5281/zenodo.24109379
Primary Topic
semigroups and automata theory
Type
preprint
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
preprint

The Look-and-Say Sequence: Terms in Output-Linear Time and Digits in O(n) Steps

Mark Kim
Zenodo (CERN European Organization for Nuclear Research)
semigroups and automata theory
preprint

The Look-and-Say Sequence: Terms in Output-Linear Time and Digits in O(n) Steps

Mark Kim
preprint en

Abstract

Let a(n) be the n-th term of the look-and-say sequence (A005150), a(1)=1, a(n+1)=D(a(n)), where D writes the length of every run of equal digits followed by the digit, and let |a(n)| ~ 1.567 * lambda^n be its number of digits, lambda=1.3036 (A005341). Every term is a concatenation of strings from a set A of 99 strings, the 92 Conway elements and 7 transient words, and A is generated by a cut test and verified by a finite closure check that proves a(t+1) is the product of x over w_t for the word w_t = sigma^t(1). This gives three exact algorithms: the whole term a(n) in |a(n)|(1+o(1)) bytes of memory copy plus O(lambda^(n/2)) other operations, which is optimal because the output has that size; any digit or block of a(n) in O(n) steps on big integers, without building the term; and the length |a(n)| and the numbers of digits 1,2,3 in a(n) from linear recurrences of order at most 79 (order 72 for the length), proved by a finite residual check. All claims are proved. In Python, a(68) with 105,745,224 digits takes 0.05 s, 48 times less than stepwise expansion over Conway elements; |a(10^5)| takes 0.99 s and |a(10^6)| takes 36.9 s; a digit of a(3000) at position 10^300 is read in 0.96 ms. The OEIS table of A005150 stops at n=25.

Zenodo (CERN European Organization for Nuclear Research)
semigroups and automata theory
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon
The Look-and-Say Sequence: Terms in Output-Linear Time and Digits in O(n) Steps — Mark Kim · Zenodo (CERN European Organization for Nuclear Research) (2026) | TGRS Research Map | TGRS