Wednesday, November 9, 2016

algebra precalculus - Highest power of a prime p dividing N!



How does one find the highest power of a prime p that divides N! and other related products?



Related question: How many zeros are there at the end of N!?







This is being done to reduce abstract duplicates. See
Coping with *abstract* duplicate questions. and List of Generalizations of Common Questions for more details.


Answer



Largest power of a prime dividing N!



In general, the highest power of a prime p dividing N! is given by



sp(N!)=Np+Np2+Np3+



The first term appears since you want to count the number of terms less than N and are multiples of p and each of these contribute one p to N!. But then when you have multiples of p2 you are not multiplying just one p but you are multiplying two of these primes p to the product. So you now count the number of multiple of p2 less than N and add them. This is captured by the second term Np2. Repeat this to account for higher powers of p less than N.




Number of zeros at the end of N!



The number of zeros at the end of N! is given by N5+N52+N53+ where xy is the greatest integer xy.



To make it clear, write N! as a product of primes N!=2α23α25α57α711α11 where αiN.



Note that α5<α2 whenever N2. (Why?)



The number of zeros at the end of N! is the highest power of 10 dividing N!




If 10α divides N! and since 10=2×5, 2α|N! and 5α|N!. Further since α5<α2, the highest power of 10 dividing N! is the highest power of 5 dividing N! which is α5.



Note that there will be 



 1. A jump of 1 zero going from (N1)! to N! if 5N



 2. A jump of 2 zeroes going from (N1)! to N! if 52N



 3. A jump of 3 zeroes going from (N1)! to N! if 53N and in general




 4. A jump of k zeroes going from (N1)! to N! if 5kN



where ab means a divides b and gcd(a,ba) = 1.



Largest power of a prime dividing other related products



In general, if we want to find the highest power of a prime p dividing numbers like 1×3×5××(2N1), P(N,r), (Nr), the key is to write them in terms of factorials.



For instance, 1×3×5××(2N1)=(2N)!2NN!. Hence, the largest power of a prime, p>2, dividing 1×3×5××(2N1) is given by sp((2N)!)sp(N!), where sp(N!) is defined above. If p=2, then the answer is sp((2N)!)sp(N!)N.




Similarly, P(N,r)=N!(Nr)!. Hence, the largest power of a prime, dividing P(N,r) is given by sp(N!)sp((Nr)!), where sp(N!) is defined above.



Similarly, C(N,r)=(Nr)=N!r!(Nr)!. Hence, the largest power of a prime, dividing C(N,r) is given by sp(N!)sp(r!)sp((Nr)!) where sp(N!) is defined above.


No comments:

Post a Comment

analysis - Injection, making bijection

I have injection f:AB and I want to get bijection. Can I just resting codomain to f(A)? I know that every function i...