Base-p digit sum Created 2026-09-28 Updated 2026-10-18
For a nonnegative integer and integer base , write its base-p expansion asThe base- digit sum is , with . When is a prime number, the Legendre formula becomesTo see the connection, divide the base-p expansion by and discard the fractional part. Swapping the resulting finite sums and using a finite geometric series givesIn particular, , so and . The leading numeral digit contributes thirteen, the next contributes eight, the next one, and the units contribute zero. Thus the base-p digit sum compresses the same contribution ledger into information already present in positional notation.
Euclidean division Created 2026-10-06 Updated 2026-10-14
For an integer and positive integer , Euclidean division writes with unique integer quotient and remainder . For , repeated quotient-and-remainder steps yield the digits of a base-p expansion when . The uniqueness follows because the difference of two permitted remainders cannot be a nonzero multiple of .
Kummer's theorem 2026-10-18
For a prime number and integers , the P-adic valuation of the binomial coefficient equals the number of arithmetic carries in the base- addition of and .[ref]
Number Theory for Mathematical Contests by David Anthony Santos. David A. Santos, Number Theory for Mathematical Contests, revision 31 October 2007, §8.3, Theorem 246, printed p. 90: carry count for a binomial coefficient
Indeed, subtract the two denominator factorial valuations in the Legendre formula:Each arithmetic carry accounts for one unit of this quotient by subadditivity of the base-p digit sum. In particular, the binomial coefficient is divisible by exactly when at least one carry occurs.For , the factorial counts giveThe matching base-p expansions are and . Their units add to two; the next column gives , sending one carry into the nines column. That column then gives , and no further carry occurs. The result is . The base-p digit sums check the same result: . Consequently is divisible by three but not by nine.
Lucas's theorem 2026-10-06
For a prime number , the binomial coefficient modulo factors into the corresponding digit binomial coefficients in the base-p expansions of the nonnegative integers . Pad both expansions to the same length and use when . The identity follows by factoring into digit powers and using the Frobenius endomorphism; digit uniqueness identifies each coefficient.
Past exam of the mathematics course of the University of Cambridge 2015 ia Paper 4 6E iii Solution Created 2026-09-24 Updated 2026-10-06
Write both nonnegative integers in base-p expansions, padding with zero digits to a common length . By the preceding polynomial identity,Expanding the last product with the binomial theorem, each term is obtained by choosing an integer with . Its exponent is and its coefficient is . Uniqueness of base-p expansions says that the only way this exponent can equal is to choose for every .
If some , no such term exists and the coefficient is zero. Otherwise its coefficient is precisely the product below. Comparing the coefficient of proves Lucas theorem:with the convention for . This also covers , and padding either expansion by further zero digits multiplies the product only by .
Past exam of the mathematics course of the University of Cambridge 2015 ia Paper 4 6E i Solution Created 2026-09-24 Updated 2026-10-06
Suppose two base-p expansions represent the same nonnegative integer. Pad the shorter one by trailing zero digits so that both have the same length. Reducing modulo shows that their first digits satisfy . Since both digits lie between and , they are equal as integers.
Subtract that common digit and divide by . The remaining equality is an equality of two base-p expansions with one fewer digit. Repeating this argument shows that every pair of corresponding digits agrees. Equivalently, repeated Euclidean division recovers the digits as remainders. The digits are unique up to padding by zeroes. The finite nonnegative-digit representation presupposes ; a negative integer has no such expansion.
