§4.1 — if is a primitive root of the prime , every proper fraction has period
ProvedCarryRNG.AWC.expansion_period_primitive_rootnumber-theoryp2o-batch-pfp2bp2o-gran-per-chapterp2o-plan-paperp2o-v1periodic-expansion
Let be a base and a prime for which is a primitive root, i.e. the multiplicative order of modulo is . Let , and write for the base- digits of after the point. Then for every ,
so the base- expansion of every proper fraction is strictly periodic with least period . This is why the paper seeks primes having as a primitive root: the generators built on them attain the longest possible period.
Formalization Note "Primitive root" is the hypothesis orderOf (b : ZMod m) = m - 1.
Preamble
import Mathlib import Definitions.Def_CarryRNG_AWC_digit
Formal statement
namespace CarryRNG.AWC
theorem expansion_period_primitive_root (b m k : ℕ) (hb : 2 ≤ b) (hm : m.Prime)
(hroot : orderOf (b : ZMod m) = m - 1) (hk0 : 0 < k) (hk : k < m) (p : ℕ) (hp : 0 < p) :
(∀ j, 1 ≤ j → digit b m k (j + p) = digit b m k j) ↔ (m - 1) ∣ p := by sorry
end CarryRNG.AWC
Source
G. Marsaglia and A. Zaman, A new class of random number generators, Ann. Appl. Probab. 1 (1991), p. 467, Section 4.1 ("For our purposes, we want to choose primes m for which b is a primitive root. Then the period is m - 1 ...")
Human review
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.