For a prime \(p\) and \(n\in\mathbb{N}\), you've probably seen this formula somewhere for the highest power of \(p\) dividing \(n!\):
i≥1∑⌊pin⌋
In fact, there's a much more surprising formula (let's face it, this one isn't that hard to derive): suppose n=(b0b1b2...br)p, or
n=b0pr+b1pr−1...+br
and let δ(n) be the digit sum of n base p. Then the highest power of p dividing n! is
p−1n−δ(n)
Wow. That's a heck of a lot shorter, isn't it? But why does this even work? Let's prove it below...
p−1n−δ(n)=p−1n−(b0+b1+...br)=p−1k=0∑rbk(pr−k−1)
Then factor pr−k−1 (by difference of nth powers) and cancel the p−1 in the denominator. This results in
k=0∑rbk(1+p+p2...pr−k−1)=br−1+(br−2p+br−2)…
Now write this sum out - term by term - in columns (not a typo, I mean columns - there's a trick here):
k=0∑rbk(j=0∑r−k−1pj)=(br−1+br−2p+⋯+b0pr−1) +(br−2+⋯+b0pr−2)
⋮
+b0
Okay, while each term was written by column before, let's look at the rows now. In fact, each row is equal to a term in this familiar expression:
k=1∑r⌊pkn⌋
because each time you divide by p again one term in the base p expansion vanishes (that associated with p0) and the others go down an exponent of p. So, we have
k=1∑r⌊pkn⌋=p−1n−δ(n)
#NumberTheory
#Primes
#DigitSum
#Factorials
#NumberBases
Easy Math Editor
This discussion board is a place to discuss our Daily Challenges and the math and science related to those challenges. Explanations are more than just a solution — they should explain the steps and thinking strategies that you used to obtain the solution. Comments should further the discussion of math and science.
When posting on Brilliant:
*italics*
or_italics_
**bold**
or__bold__
paragraph 1
paragraph 2
[example link](https://brilliant.org)
> This is a quote
\(
...\)
or\[
...\]
to ensure proper formatting.2 \times 3
2^{34}
a_{i-1}
\frac{2}{3}
\sqrt{2}
\sum_{i=1}^3
\sin \theta
\boxed{123}
Comments
Wow! Nice, let me see whether I can apply to this question.