greedy_distinct_diff_seq
def
The greedy sequence with distinct consecutive differences started at a₁, a₂ (term 0 is a₁, term 1 is a₂; each later term is the least unused positive integer whose difference with the previous term is new).
Statement
noncomputable def greedy_distinct_diff_seq (a₁ a₂ : ℕ) : ℕ → ℕ
- Defined in
- arXiv:2610.15860 (A note on the Slater–Vélez permutation), first paragraph (the greedy rule, here with arbitrary starting terms).
- Verified
- 14 Oct 2026
- Axioms
- none listed
- Built on 1
- greedy_distinct_diff_historyThe first n + 2 terms of the greedy sequence started at a₁, a₂, most recent first.
- Used by 3
- greedy_distinct_diff_seq_one_two_twoThe greedy sequence started at 1, 2 has third term 4 (3 is refused since |3 − 2| = 1 is already a difference).
- greedy_distinct_diff_seq_one_two_surjectiveThe greedy sequence with distinct consecutive differences started at 1, 2 takes every positive integer as a value.
- greedy_distinct_diff_seq_surjectiveConjecture: for any distinct positive integers a₁, a₂, the greedy sequence with distinct consecutive differences started at a₁, a₂ takes…
Lean source view module on GitHub
/-- The greedy sequence with distinct consecutive differences started at `a₁, a₂` (0-indexed). -/ noncomputable def greedy_distinct_diff_seq (a₁ a₂ : ℕ) : ℕ → ℕ | 0 => a₁ | n + 1 => (greedy_distinct_diff_history a₁ a₂ n).headD 0