Statement Presentations and a Semilinear Greedy 3-Sumfree Sequence
Abstract
We prove a parametric formula for the greedy 3-sumfree sequence beginning with \(1,g,g+d\), where \(d\geq 2\) and \(g\geq d+1\). If \(M=5g+2d\), then the sequence consists exactly of the two initial exceptional elements \(1,g\), the first interval \([g+d,2g+d]\), and then the periodic interval pattern with residues \(g+d-2,\ldots,2g+d-2\) modulo \(M\). The proof is elementary and finite: a semilinear candidate is shown to be 3-sumfree by a residue exclusion, and every integer omitted after the initial seed is shown to be blocked by one of four interval-sum templates.
The proof has a presentation-theoretic reading. The greedy recursion is represented by a semilinear witness language together with finite verification data for the fixed-point condition. The result illustrates how a mathematical statement can be handled through a structured presentation of the witnesses that decide it.
1 Introduction
Greedy sequences are often easy to define and difficult to recognize. Their membership rule is recursive: whether a later integer is admitted depends on all earlier admitted integers. A closed formula, when it exists, replaces this history-dependent object by a more rigid presentation.
This note proves such a formula for a family of greedy 3-sumfree sequences. Fix integers
Let \(S_{g,d}\) be the increasing sequence that starts with
and then admits each integer \(n>g+d\) precisely when \(n\) is not a sum of three distinct earlier admitted terms.
The theorem says that \(S_{g,d}\) is eventually periodic, with an explicit period and one interval of residues per period. The proof has two finite parts. First, the proposed set contains no element that is a sum of three distinct elements of itself. Second, every omitted integer after \(g+d\) is such a sum of three smaller proposed elements. These two facts force the greedy recursion to produce exactly the proposed set.
This is the presentation-theoretic step: the infinite greedy process is presented by a semilinear witness language and a finite family of interval-sum verifications.
2 Statement presentations
A statement presentation records a mathematical assertion through the witness object that controls its truth. It consists of three pieces:
a universe \(U\) of possible witnesses;
a witness object \(W\subseteq U\), or a structured object built from such witnesses;
a statement type imposed on \(W\), such as emptiness, non-emptiness, infinitude, equality with another witness object, eventual periodicity, or boundedness.
For example, a universal statement \(\forall u\,P(u)\) can be presented by the bad set
with statement type ``empty''. An existence statement \(\exists u\,P(u)\) can be presented by the solution set \(\{u:P(u)\}\) with statement type ``nonempty''. An eventual statement can be presented by the finite set of exceptions.
In this note the witness object is a subset of \(\mathbb N\), namely the greedy sequence \(S_{g,d}\). The statement type is equality:
where \(T_{g,d}\) is an explicit semilinear set. The verification data are finite interval-sum templates proving the two inclusions required by the greedy fixed-point rule.
3 The greedy sequence and the formula
For a set \(A\subseteq\mathbb N\), write
The greedy 3-sumfree sequence with initial terms \(1,g,g+d\) is the set \(S_{g,d}\subseteq\mathbb N\) defined as follows. The elements \(1,g,g+d\) are included initially. For each \(n>g+d\), in increasing order, one includes \(n\) if and only if
Set
Theorem 3.1 (Semilinear formula).
Let \(d\geq 2\) and \(g\geq d+1\). Then
if and only if either
or
Equivalently, \(S_{g,d}\) is the set
4 The semilinear candidate
Define
and, for \(q\geq 1\),
Let
This is the set described in the theorem. Indeed, for \(q\geq 1\), the block \(I_q\) consists exactly of the integers congruent to a residue in \(R\) modulo \(M\). In the initial period, the condition \(n\geq g+d\) keeps the interval \([g+d,2g+d-2]\), and the two remaining points \(2g+d-1,2g+d\) are the exceptional endpoint terms.
We prove that the greedy sequence is \(T\). The proof uses only elementary interval arithmetic.
5 Interval-sum facts
Lemma 5.1 (Sums of intervals).
Let \(J=[A,B]\cap\mathbb Z\), with \(A\leq B\). Then:
provided \(|J|\geq 2\), and
provided \(|J|\geq 3\). If \(J=[A,B]\cap\mathbb Z\) and \(K=[C,D]\cap\mathbb Z\), then
Proof.
For two distinct elements of \(J\), the smallest sum is \(A+(A+1)\) and the largest is \((B-1)+B\). Every intermediate value is reached by increasing one summand at a time, keeping the two summands distinct. The proof for three distinct elements is identical, starting from \(A+(A+1)+(A+2)\) and ending at \((B-2)+(B-1)+B\). The formula for the sum of two intervals is immediate.
6 The candidate is 3-sumfree
We first prove that \(T\) contains no sum of three distinct elements of \(T\).
Proposition 6.1.
The set \(T_{g,d}\) is 3-sumfree:
Proof.
The smallest possible sum of three distinct elements of \(T\) is
Hence no element of \(\{1,g\}\cup I_0\) can be such a sum, since
It remains to exclude sums that land in a later block \(I_q\), \(q\geq 1\). Such an element has residue in
modulo \(M=5g+2d\).
The residues of elements of \(T\) lie in
The four residues in \(E\) occur only at the four exceptional elements, so if more than one exceptional residue is used, those exceptional elements must be distinct.
We check that no sum of three admissible residues lies in \(R\) modulo \(M\).
First consider three residues from \(R\). Their ordinary sum lies in
Modulo \(M\), this is contained in
with empty intervals omitted. The first part is above \(b=2g+d-2\), and the second part is below \(a=g+d-2\). Thus it is disjoint from \(R\).
Next take two residues from \(R\) and one exceptional residue. We have:
Each displayed set is disjoint from \(R\). In the first two rows it lies strictly above \(b\). In the last two rows the high part lies above \(b\), while the low part lies below \(a\).
Now take two exceptional residues and one residue from \(R\). The possible intervals are:
Again each set is disjoint from \(R\). The first five lie strictly above \(b\), and the last lies below \(a\), apart from the residue \(M-1\).
Finally, the sums of three distinct exceptional residues are
None belongs to \(R\) modulo \(M\).
Therefore no sum of three distinct elements of \(T\) can land in a later block. Since it also cannot land in \(\{1,g\}\cup I_0\), the set \(T\) is 3-sumfree.
7 Every omitted integer is blocked
We now prove the converse fixed-point condition: after the initial seed, every integer omitted by \(T\) is a sum of three smaller elements of \(T\).
Proposition 7.1.
Let \(n>g+d\). If \(n\notin T\), then
Proof.
The complement of \(T\) after \(g+d\) is the union of the gaps between consecutive blocks.
First consider the gap after \(I_0\). Since
and the next block begins at
the first gap is
It is covered by the following four interval-sum templates:
where the repeated occurrences of \(I_0\) mean that distinct elements are chosen. These formulas follow from the interval-sum lemma.
The four intervals overlap or touch. Indeed,
because \(g\geq d\);
and
because \(2g-d\geq 3\), which follows from \(g\geq d+1\) and \(d\geq 2\). Hence the four templates cover all of \(G_0\). Every summand used belongs to \(\{1,g\}\cup I_0\), and is smaller than the corresponding \(n\in G_0\).
Now consider a later gap. For \(q\geq 1\),
so the gap following \(I_q\) is
Since \(M=5g+2d\), this is
The gap \(G_q\) is covered by:
again with distinct choices when \(I_0\) appears twice.
These intervals also overlap or touch:
because \(g\geq d-1\);
and
because \(2g\geq d\). Thus they cover \(G_q\). All summands are smaller than the integer \(n\) being represented: the elements of \(I_q\) lie before the gap, and \(1,g,I_0\) are earlier still.
Therefore every omitted integer \(n>g+d\) is blocked by three distinct smaller elements of \(T\).
8 Proof of the formula
Proof.
We prove by induction on \(n\) that the greedy construction agrees with \(T\).
The initial elements \(1,g,g+d\) belong to \(T\) and are included by definition of the greedy sequence. Now suppose the two sets agree below \(n\), where \(n>g+d\).
If \(n\in T\), then Proposition 6.1 shows that \(n\) is not a sum of three distinct elements of \(T\). In particular, using the induction hypothesis below \(n\), it is not a sum of three distinct earlier greedy terms. Hence the greedy rule includes \(n\).
If \(n\notin T\), then Proposition 7.1 expresses \(n\) as a sum of three distinct smaller elements of \(T\). By the induction hypothesis these are earlier greedy terms. Hence the greedy rule excludes \(n\).
Thus the greedy sequence and \(T\) agree at \(n\). Induction proves \(S_{g,d}=T\), which is exactly the claimed semilinear formula.
9 Presentation-theoretic reading
The proof can be read as a compact example of statement presentation.
The original witness object is the recursively defined set
The proposed presentation replaces it by the semilinear language
The statement type is equality of witness languages:
The fixed-point condition for the greedy rule has two observable parts:
and
with the second inclusion understood using smaller summands.
Both parts are verified by finite data:
a finite residue exclusion modulo \(M\);
four interval-sum templates for the first gap;
four periodic interval-sum templates for all later gaps.
The proof compiles the recursively defined statement into a semilinear normal form and verifies the normal form by finite arithmetic. This is the reusable pattern: when a recursively defined witness language admits a low-cost semilinear presentation, the global statement may reduce to finitely many local templates.
10 Further directions
The same method suggests a search pattern for other greedy additive sequences. One proposes an eventually semilinear set \(T\), then checks:
and
by finite residue and interval-sum templates. When the candidate is automatic rather than semilinear, the analogous verification can often be delegated to finite automata. In both cases the mathematical content includes the final periodic formula and the controlled replacement of a recursive witness object by a finite presentation.
References
- [1] W. Bosma, R. Bruin, R. Fokkink, J. Grube, A. Reuijl, and T. Tromp, Using Walnut to Solve Problems from the OEIS, Journal of Integer Sequences 28 (2025), Article 25.3.8.
- [2] J. Shallit, The Logical Approach to Automatic Sequences: Exploring Combinatorics on Words with Walnut, London Mathematical Society Lecture Note Series 482, Cambridge University Press, 2022.
- [3] H. Mousavi, Automatic theorem proving in Walnut, arXiv:1603.06017.