OEIS A166944 — the offset coordinate B, attained previous maxima, and the last nontrivial increment
Definitiona166944_canonicalThis bundle adds the three derived predicates used by the record-index and canonical-return statements about OEIS A166944.
The sequence is the Rowland-type recursion of A166944, with first differences .
- The offset coordinate is
the distance of from the linear comparison sequence . A return marks the point at which , i.e. the sequence has caught up with its linear benchmark.
-
A pair exhibits as an attained previous maximum through when for every and for some : the value is a running maximum of the differences on the prefix and it actually occurs there. The occurrence is intentionally existential; the first occurrence is extracted by a separate theorem so that it can be used as a strict difference record.
-
A pair exhibits as the last nontrivial increment before when , the increment at is nontrivial (), and every increment strictly after and up to is trivial ( for ). This is a predicate only: it asserts no existence, and it is supplied to the theorems that need it as a hypothesis.
The three declarations are the vocabulary in which the record-index equivalence is stated: the difference records of A166944 are exactly the strict records whose index sits two above the record value, and that claim is equivalent to excluding a larger first hit inside the horizon of a capped canonical replay. Making , IsAttainedPreviousMaximum and IsLastNontrivialBefore first-class definitions keeps that equivalence importable instead of restating it locally.
Formalization Note B uses truncated subtraction on Nat. All three predicates restrict their indices to , the range in which the recurrence's differences are defined without truncation artifacts.
import Definitions.Def_a166944_record_core
namespace A166944Research
/-- `B n = a n - (2n - 2)`. -/
def B (n : Nat) : Nat := a n - (2 * n - 2)
/-- `P` is an attained running maximum through `k`. -/
def IsAttainedPreviousMaximum (P k : Nat) : Prop :=
(∀ j : Nat, 2 ≤ j → j ≤ k → d j ≤ P) ∧
∃ r : Nat, 2 ≤ r ∧ r ≤ k ∧ d r = P
/-- A candidate last nontrivial increment before `m` (a predicate only). -/
def IsLastNontrivialBefore (rho m : Nat) : Prop :=
2 ≤ rho ∧ rho < m ∧ 1 < d rho ∧
∀ j : Nat, rho < j → j ≤ m → d j = 1
end A166944Research