Talk:Legendre's formula

"Alternate form"
The article contained (until I just removed it) a long section titled "Alternate form"

One may also reformulate Legendre's formula in terms of the base-p expansion of n. Let $$s_p(n)$$ denote the sum of the digits in the base-p expansion of n; then
 * $$\nu_p(n!) = \frac{n - s_p(n)}{p - 1}.$$

For example, writing n = 6 in binary as 610 = 1102, we have that $$s_2(6) = 1 + 1 + 0 = 2$$ and so
 * $$\nu_2(6!) = \frac{6 - 2}{2 - 1} = 4.$$

Similarly, writing 6 in ternary as 610 = 203, we have that $$s_3(6) = 2 + 0 = 2$$ and so
 * $$\nu_3(6!) = \frac{6 - 2}{3 - 1} = 2.$$

Write $$n = n_\ell p^\ell + \cdots + n_1 p + n_0$$ in base p. Then $$\textstyle \left\lfloor \frac{n}{p^i} \right\rfloor = n_\ell p^{\ell-i} + \cdots + n_{i+1} p + n_i$$, and therefore
 * Proof

\begin{align} \nu_p(n!) &= \sum_{i=1}^{\ell} \left\lfloor \frac{n}{p^i} \right\rfloor \\ &= \sum_{i=1}^{\ell} \left(n_\ell p^{\ell-i} + \cdots + n_{i+1} p + n_i\right) \\ &= \sum_{i=1}^{\ell} \sum_{j=i}^{\ell} n_j p^{j-i} \\ &= \sum_{j=1}^{\ell} \sum_{i=1}^{j} n_j p^{j-i} \\ &= \sum_{j=1}^{\ell} n_j \cdot \frac{p^j - 1}{p - 1} \\ &= \sum_{j=0}^{\ell} n_j \cdot \frac{p^j - 1}{p - 1} \\ &= \frac{1}{p - 1} \sum_{j=0}^{\ell} \left(n_j p^j - n_j\right) \\ &= \frac{1}{p - 1} \left(n - s_p(n)\right). \end{align} $$

I have removed it because (1) it was completely uncited, and (2) I do not believe that this formula is referred to by anyone as "Legendre's formula", or as a form of Legendre's formula -- I think it's a totally separate formula for the same quantity. I would not object to restoring it, provided sources can be found that support the idea that this version is also known as Legendre's formula -- but if so, the proof should probably be removed (or at least abbreviated). --JBL (talk) 16:41, 12 March 2022 (UTC)


 * "Alternate form" might not be the right section title, but I disagree that it doesn't belong in the article. The two formulas are not totally separate; they both show how $$\nu_p(n!)$$ depends on the base-$$p$$ representation of $$n$$. They are equivalent and can be derived from each other. The section was only long because of the proof; if the proof is not necessary, let's leave it out. The citation should be the Moll reference, which says "An explicit expression for the error term $$\nu_p(n!) \sim n/(p - 1)$$ was discovered by A. M. Legendre" and then immediately states a theorem that $$\nu_p(n!) = \frac{n - s_p(n)}{p - 1}$$. Eric Rowland (talk) 21:39, 15 March 2022 (UTC)