Digits of j + b * y, factorials of digits, cyclic shifts of digits and redundant words #
For a digit j < b, the base-b digits of j + b * y are j followed by the digits of y.
This gives the digit sum and the products over the digits of j + b * y in terms of those of
y. The product of the factorials of the base-p digits of n is prime to p, since every
digit is less than p. These facts index the digit induction in Stickelberger's congruence.
For 0 ≤ a < b ^ f - 1, multiplication by b modulo b ^ f - 1 cyclically shifts the f
base-b digits of a. Summing the f shifts b ^ i * a % (b ^ f - 1), every digit of a
occurs once in every position, so (b - 1) ∑_{i < f} (b ^ i * a % (b ^ f - 1)) = (b ^ f - 1) s(a)
with s(a) the digit sum of a; equivalently s(a) = (b - 1) ∑_{i < f} {b ^ i a / (b ^ f - 1)}.
For a = (b ^ f - 1) / m * t this reads m s(a) = (b - 1) ∑_{i < f} (b ^ i t % m). With b = p
and b ^ f = q the size of a finite field, this identity turns the digit-sum valuation of Gauss
sums into the exponents t of Stickelberger's element ∑ t σ_t⁻¹.
Allowing the digits 0, …, 2b, every z ≤ 2 b ^ n with n ≥ 1 is the base-b value of a word
of length exactly n. Such redundant words of a fixed length let an automaton append the same
suffix of length n to two prefixes and reach every offset in the doubled interval [0, 2 b ^ n],
as in Krebs's proof of Cobham's theorem.
Main results #
Nat.exists_length_eq_ofDigits_eq_of_le_two_mul_pow: forn ≥ 1, everyz ≤ 2 b ^ nis the value of a word of lengthnwith digits at most2b.Nat.sum_digits_add_mul: the digit sum ofj + b * yisjplus the digit sum ofy.Nat.prod_map_digits_add_mul:∏ g(dᵢ)over the digits ofj + b * yisg jtimes the product over the digits ofy, wheneverg 0 = 1.Nat.Prime.not_dvd_prod_factorial_digits:pdoes not divide the product of the factorials of the base-pdigits ofn.Nat.sub_one_mul_sum_div_pow_succ_eq_sub_sum_digits: Legendre's identity(b - 1) ∑_{i < f} ⌊a / b ^ (i + 1)⌋ = a - s(a)fora < b ^ f, summed over a fixed range.Nat.pow_mul_mod_pow_add_sub_one:b ^ i * a % (b ^ (i + k) - 1)is the cyclic shifta / b ^ k + b ^ i * (a % b ^ k)of the digits ofa < b ^ (i + k) - 1.Nat.sub_one_mul_sum_pow_mul_mod_eq_mul_sum_digits: the sum of the cyclic shifts,(b - 1) ∑_{i < f} (b ^ i * a % (b ^ f - 1)) = (b ^ f - 1) s(a)fora < b ^ f - 1.Nat.sub_one_mul_sum_pow_mul_mod_eq_mul_sum_digits_div_mul: form ∣ b ^ f - 1andt < m,(b - 1) ∑_{i < f} (b ^ i * t % m) = m s((b ^ f - 1) / m * t).
References #
- S. A. Katre, Gauss–Jacobi sums and Stickelberger's theorem, §3.
- L. C. Washington, Introduction to Cyclotomic Fields, 2nd ed., §6.2.
- Thijmen J. P. Krebs, A more reasonable proof of Cobham's theorem, 2018, arXiv:1801.06704, §3.
Short redundant words cover a doubled radix interval. For n ≥ 1, every z ≤ 2 b ^ n is
the base-b value, read least significant digit first, of a word of length exactly n with digits
at most 2b. The upper endpoint 2 b ^ n is included; for n = 0 only z = 0 is the value of a
word of length n.
Legendre's identity over a fixed range. For a < b ^ f,
(b - 1) ∑_{i < f} ⌊a / b ^ (i + 1)⌋ = a - s(a), where s(a) is the base-b digit sum of a.
This is Nat.sub_one_mul_sum_log_div_pow_eq_sub_sum_digits with the sum extended by zero terms
from log b a + 1 to f.
The sum of the cyclic shifts of the digits. For a < b ^ f - 1,
(b - 1) ∑_{i < f} (b ^ i * a % (b ^ f - 1)) = (b ^ f - 1) s(a), where s(a) is the base-b
digit sum of a. Equivalently s(a) = (b - 1) ∑_{i < f} {b ^ i a / (b ^ f - 1)}, with {·} the
fractional part.