OEIS sequence

A086183 — exact computation with a suffix automaton

Published on OEIS | 2026

A086183 asks for the largest number appearing as a substring in both the first n decimal digits of Pi and the overlapping block from positions n through 2n-1.

I developed a C++20 program for exact computation and submitted a complexity analysis based on a suffix automaton and suffix ranks. During editorial discussion, I revised the statement to make the computational model explicit: the first 2n-1 digits of Pi are treated as input, and the cost of generating those digits is not included in the stated time and memory bounds.

Under this model, the comment states that a(n) can be computed in O(n) time and O(n) space, while a(1) through a(N) can be computed in O(N^2) time with O(N) working memory by extending the suffix automaton incrementally. The revision was reviewed and published by OEIS editor Sean A. Irvine on September 10, 2026.

Exact computation

The computation can be formulated as a longest-common-substring-style problem between two overlapping blocks of decimal digits of Pi. A suffix automaton provides a compact representation for exact substring matching, while suffix-ranking information is used to identify the numerically largest qualifying substring.

Complexity clarification

The complexity statement was revised after editorial discussion to distinguish computation on already available digits of Pi from the separate cost of generating those digits. Given the first 2n-1 digits as input, the bound for a single a(n) is O(n) time and O(n) space.

Incremental computation

By extending the suffix automaton incrementally, the values a(1) through a(N) can be computed in O(N^2) total time while using O(N) working memory, excluding the separate cost of computing the required digits of Pi.

View A086183 on OEIS