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 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-1) \times (n-2) ...
''n''
!. It is named after
Adrien-Marie Legendre
Adrien-Marie Legendre (; ; 18 September 1752 – 9 January 1833) was a French mathematician who made numerous contributions to mathematics. Well-known and important concepts such as the Legendre polynomials and Legendre transformation are named ...
. It is also sometimes known as de Polignac's formula, after
Alphonse de Polignac
Alphonse de Polignac (1826–1863) was a French mathematician. In 1849, the year he was admitted to Polytechnique, he made what's known as Polignac's conjecture:
From p. 400: ''"1er ''Théorème.'' Tout nombre pair est égal à la diffé ...
.
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 and computer science, 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 i ...
. 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
In mathematics, Kummer's theorem is a formula for the exponent of the highest power of a prime number ''p'' that divides a given binomial coefficient. In other words, it gives the ''p''-adic valuation of a binomial coefficient. The theorem is na ...
. 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 Field (mathematics), fields and classical grou ...
, ''
History of the Theory of Numbers
''History of the Theory of Numbers'' is a three-volume work by L. E. Dickson summarizing work in number theory up to about 1920. The style is unusual in that Dickson mostly just lists results by various authors, with little further discussion. T ...
'', Volume 1, Carnegie Institution of Washington, 1919, page 263.
External links
*{{MathWorld, Factorial, Factorial
Factorial and binomial topics