Counting deficient-carry ternary units #
Powers of two modulo a power of three range over unit residues, whose least
significant ternary digit is nonzero. This file refines the full-word automaton
count to that unit slice. Among unit words of length n + 3, exactly
(n + 9) * 2 ^ n create fewer than two doubling carries.
Natural value of a fixed-length ternary word.
Equations
- GKPCarry.ternaryWordValue word = Nat.ofDigits 3 (GKPCarry.ternaryWordDigits word)
Instances For
The value of a ternary word, packaged in its complete residue block.
Equations
- GKPCarry.ternaryWordValueFin word = ⟨GKPCarry.ternaryWordValue word, ⋯⟩
Instances For
Fixed-length ternary words with a nonzero least significant digit. The
parameter is the tail length, so the full word has length length + 1.
Equations
Instances For
Split a unit word into its nonzero head digit and its remaining digits.
Equations
- One or more equations did not get rendered due to their size.
Instances For
There are 2 * 3 ^ length unit words with length + 1 ternary digits.
Convert a ternary unit word to the corresponding unit modulo a power of three.
Equations
- GKPCarry.ternaryUnitWordToUnit length word = ZMod.unitOfCoprime (GKPCarry.ternaryWordValue ↑word) ⋯
Instances For
Unit words are equivalent to the full unit group modulo the corresponding power of three.
Equations
- GKPCarry.ternaryUnitWordEquiv length = Equiv.ofBijective (GKPCarry.ternaryUnitWordToUnit length) ⋯
Instances For
Fixed-length leading zeroes do not change the carry count, so a word and the canonical ternary expansion of its value have the same count.
Deficient-carry unit words #
Unit words whose doubling produces fewer than two carries.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Remove the nonzero leading digit and record the automaton state it enters.
Equations
Instances For
Peeling the nonzero least significant digit splits deficient unit words
into the states reached by digit 1 and digit 2.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Exact deficient-carry count on ternary unit words of length n + 3.