What is the formula for finding the highest power of x that is divisible by n!?

  • Context: Undergrad 
  • Thread starter Thread starter twoflower
  • Start date Start date
  • Tags Tags
    Formula General
Click For Summary

Discussion Overview

The discussion revolves around finding the highest power of a number \( x \) that divides \( n! \) (n factorial). Participants explore various methods, including prime factorization and potential formulas, while addressing specific examples like the case of 5 dividing 50!. The scope includes mathematical reasoning and theoretical exploration.

Discussion Character

  • Mathematical reasoning
  • Exploratory
  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant seeks a general formula for determining the highest power of \( x \) that divides \( n! \), specifically asking about the case of 5 and 50!.
  • Another participant suggests that prime factorization of both \( x \) and \( n! \) simplifies the problem, noting that 5 appears 12 times in the prime factorization of 50!, leading to a claim about the highest power of 5 dividing 50! being 512.
  • A different participant introduces a sequence-based approach to associate factorials with prime powers, indicating that the exponents of primes change in a specific pattern, though they express uncertainty about deriving a general formula from this observation.
  • One participant outlines a method involving the integer part function and logarithms to find the largest power \( p \) such that \( x^p \) divides \( n! \), suggesting a summation approach based on the prime factorization of \( x \).
  • Another participant presents an alternative formula for the exact power of a prime \( p \) dividing \( n! \), which involves the sum of the digits of \( n \) in base \( p \).

Areas of Agreement / Disagreement

There is no consensus on a single general formula for finding the highest power of \( x \) that divides \( n! \). Multiple approaches and methods are proposed, with participants expressing varying degrees of certainty and clarity regarding their effectiveness.

Contextual Notes

Some participants note the complexity of prime factorization for large \( n! \) and the potential difficulty in generalizing the observed patterns in prime powers. The discussion includes various assumptions about the nature of \( x \) (whether prime or composite) and the mathematical steps involved in deriving the highest power.

twoflower
Messages
363
Reaction score
0
Hi all,

there is general formula for findind out, "Which highest power of x is divisible n! with?" Eg. Which highest power of 5 is divisable 50! with?

But I forgot it and can't find it now...will somebody help me please?

Thank you.
 
Mathematics news on Phys.org
You mean, what is the highest power of x that divides n!? Well if you can prime-factorize x and n!, this is easy. In the case of 5 and 50!, it's hard to prime-factorize 50!, but the solution is still easy. You can see quite easily that 5 will occur 12 times in the prime-factorization of 50! (it will occur once in each of the factors 5, 10, 15, 20, 30, 35, 40, 45, and twice in both 25 and 50), so the highest power of 5 that divides 50! is 512.
 
AKG said:
You mean, what is the highest power of x that divides n!? Well if you can prime-factorize x and n!, this is easy. In the case of 5 and 50!, it's hard to prime-factorize 50!, but the solution is still easy. You can see quite easily that 5 will occur 12 times in the prime-factorization of 50! (it will occur once in each of the factors 5, 10, 15, 20, 30, 35, 40, 45, and twice in both 25 and 50), so the highest power of 5 that divides 50! is 512.

Yes, this manual approach is clear. But there is also a general formula..
 
I'm not sure about a general formula just yet, but this might be helpful: if you associate each factorial with a sequence (an,k)k in N, where an,k is the power of the kth prime in n!, you get:

(a0,k) = (0, 0, ...)
(a1,k) = (0, 0, ...)
(a2,k) = (1, 0, 0, ...)
(a3,k) = (1, 1, 0, 0, ...)
(3, 1, 0, 0, ...)
(3, 1, 1, 0, 0, ...)
(4, 2, 1, 0, 0, ...)
(4, 2, 1, 1, 0, 0, ...)
(7, 2, 1, 1, 0, 0, ...)
(7, 4, 1, 1, 0, 0, ...)
(8, 4, 2, 1, 0, 0, ...)
(8, 4, 2, 1, 1, 0, 0, ...)
(10, 5, 2, 1, 1, 0, 0, ...)
(10, 5, 2, 1, 1, 1, 0, 0, ...)
(11, 5, 2, 2, 1, 1, 0, 0, ...)

The exponent of 2 changes every 2 rows, the exponent of 3 changes every 3 rows, the exponent of p will change every p rows. Ignoring repetition, the exponents for 2 go: 0, 1, 3, 4, 7, 8, 10, 11, ...
For 3, they go 0, 1, 2, 4, 5, ...
For 5, they go 0, 1, 2, ...

Some numbers are skipped in the above sequences because powers occur, i.e. in the sequence for 2, it goes from 1 to 3 without going through 2 because the 4 in 4! contributes two 2's, not just 1. I'm very tired right now, but I suppose if you can generalize what's going on here, it might be a helpful step in finding a general formula.

Well I suppose if you just want to know the general formula and aren't trying to figure it out yourself, then the above isn't much help.
 
I suppose that this is not a homework problem... So here's my approach.
Let's say that [x] is the function that will return the integer part before the decimal point of the number x, eg: [37.5534] = 37.
Say, you need to find the largest p that satisfies:
xp divides n!, for some given x (x is prime), and n.
Let: \rho := \left[ \frac{\ln n}{\ln x} \right], ie: \rho is the largest positive integer such that: x ^ \rho \leq n
So for every x consecutive integers there's one integer that's divisible by x, for every x2 consecutive integers there's one integer that's divisible by x2, for every x3 consecutive integers there's one integer that's divisible by x3,...
So the largest p can be obtained by:
p := \sum_{i = 1} ^ \rho \left[ \frac{n}{x ^ i} \right]
---------------------
If x is not prime, then you can prime-factorize it:
x = \lambda_1 ^ {\alpha_1} \ \lambda_2 ^ {\alpha_2} \ \lambda_3 ^ {\alpha_3} \ ... \lambda_k ^ {\alpha_k}
Where: \lambda_i, \ i = 1..k are primes.
Then: x ^ p = (\lambda_1 ^ {\alpha_1} \ \lambda_2 ^ {\alpha_2} \ \lambda_3 ^ {\alpha_3} \ ... \lambda_k ^ {\alpha_k}) ^ p = \lambda_1 ^ {\alpha_1 p} \ \lambda_2 ^ {\alpha_2 p} \ \lambda_3 ^ {\alpha_3 p} \ ... \lambda_k ^ {\alpha_k p}
If xp divides n! then \lambda_i ^ {\alpha_i p}, \ i = 1..k must also divide n!.
So you can use the same method (as shown above) to find the largest \rho_i, \ i = 1..k such that \lambda_i ^ {\rho_i}, \ i = 1..k divides n!.
Then define: \beta_i := \left[ \frac{\rho_i}{\alpha_i} \right], \ i = 1..k.
And the largest p can be found by:
p = \min (\beta_i), \ i = 1..k
 
Last edited:
The exact power of a prime p dividing n! is alternatively given by

\frac{n-\mu}{p-1},

where \mu is the sum of the digits of the base p representation of n.
 

Similar threads

  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 3 ·
Replies
3
Views
923
Replies
9
Views
4K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K