Exercise · Volume 1 · 1.2.5-12
Exercise 1.2.5-12
proved in Lean solution written
| Rating | M22 |
|---|---|
| Markers | M (mathematical), recommended |
| Kind | K3, find a value: compute a number, a set or a closed form from the written solution |
| Section | Section 1.2.5 of Volume 1. Companion chapter: Permutations and factorials |
The task
Give the exponent of a prime in as a simple formula in , and the digits of in base .
The exact wording is in your copy of the book.
Hints
Open one hint at a time. Try the exercise again after each.
Hint 1
Start from eq. (8) and write each with the digits of .
Hint 2
Exercise 11 does the case . The key sum is .
Solution
Show the solution
Let with . For , the terms with are multiples of , and the terms with add up to at most . So
By eq. (8),
The sum over from gives the same value, since the term is . So
Check
For and the base-3 digits are , with digit sum . The formula gives , and eq. (8) gives . For , : , so , as in exercise 6. Python confirms the formula for and all .
Remarks
Legendre's formula is also the number of carries seen when adding in base : the exponent of in is the number of carries in the base sum , which follows from this formula applied to the three factorials. Exercise 1.2.5-14 refines it to a congruence for the part of that does not divide.
This solution is checked, and a person has not reviewed it yet. The source.
In Lean
proved The statement and its proof are in Lean. The kernel accepts the proof, and it uses the standard axioms only.
- Problem:
TAOCP.S1_2_5.Ex12.statementaxioms: Classical.choice, Quot.sound, propext - Solution:
TAOCP.S1_2_5.Ex12.solvedaxioms: Classical.choice, Quot.sound, propext
The status is computed from the Lean build. The node of the map.
Something is wrong? Report it.