In mathematics, Legendre's formula gives an expression for the exponent of the largest power of a
prime
A prime number (or a prime) is a natural number greater than 1 that is not a product of two smaller natural numbers. A natural number greater than 1 that is not prime is called a composite number. For example, 5 is prime because the only ways ...
''p'' that divides the
factorial
In mathematics, the factorial of a non-negative denoted is the Product (mathematics), product of all positive integers less than or equal The factorial also equals the product of n with the next smaller factorial:
\begin
n! &= n \times ...
''n''
!. It is named after
Adrien-Marie Legendre. It is also sometimes known as de Polignac's formula, after
Alphonse de Polignac.
Statement
For any prime number ''p'' and any positive integer ''n'', let
be the exponent of the largest power of ''p'' that divides ''n'' (that is, the
''p''-adic valuation of ''n''). Then
:
where
is the
floor function
In mathematics, the floor function is the function that takes as input a real number , and gives as output the greatest integer less than or equal to , denoted or . Similarly, the ceiling function maps to the least integer greater than or eq ...
. While the sum on the right side is an infinite sum, for any particular values of ''n'' and ''p'' it has only finitely many nonzero terms: for every ''i'' large enough that
, one has
. This reduces the infinite sum above to
:
where
.
Example
For ''n'' = 6, one has
. The exponents
and
can be computed by Legendre's formula as follows:
:
Proof
Since
is the product of the integers 1 through ''n'', we obtain at least one factor of ''p'' in
for each multiple of ''p'' in
, of which there are
. Each multiple of
contributes an additional factor of ''p'', each multiple of
contributes yet another factor of ''p'', etc. Adding up the number of these factors gives the infinite sum for
.
Alternate form
One may also reformulate Legendre's formula in terms of the
base-''p'' expansion of ''n''. Let
denote the sum of the digits in the base-''p'' expansion of ''n''; then
:
For example, writing ''n'' = 6 in
binary as 6
10 = 110
2, we have that
and so
:
Similarly, writing 6 in
ternary as 6
10 = 20
3, we have that
and so
:
Proof
Write
in base ''p''. Then
, and therefore
:
Applications
Legendre's formula can be used to prove
Kummer's theorem. As one special case, it can be used to prove that if ''n'' is a positive integer then 4 divides
if and only if ''n'' is not a power of 2.
It follows from Legendre's formula that the
''p''-adic exponential function has radius of convergence
.
References
*
* , page 77
*
Leonard Eugene Dickson
Leonard Eugene Dickson (January 22, 1874 – January 17, 1954) was an American mathematician. He was one of the first American researchers in abstract algebra, in particular the theory of finite fields and classical groups, and is also rem ...
, ''
History of the Theory of Numbers'', Volume 1, Carnegie Institution of Washington, 1919, page 263.
External links
*{{MathWorld, Factorial, Factorial
Factorial and binomial topics