Finding Prime Factors in Factorials or # of Numbers in Factorials

Finding the Number of Prime Factors in a Factorial

This section details a systematic method for determining the count of a specific prime factor within a given factorial.

Initial Approach and its Limitations

When asked to find the number of a particular prime factor in a factorial (e.g., how many twos are in 8!8!), a natural first thought might be to list out the factorial and count the multiples:

  • Example: 8!8!

    • 8×7×6×5×4×3×2×18 \times 7 \times 6 \times 5 \times 4 \times 3 \times 2 \times 1

    • Multiples of 22: 2,4,6,82, 4, 6, 8

    • An initial incorrect count might be 44.

  • Why this is incomplete: This simple count overlooks that numbers like 44 contain more than one factor of 22 (4=224 = 2^2 has two twos), and 88 contains even more (8=238 = 2^3 has three twos). A more rigorous system is needed.

Example 1: Finding Twos in 8!8!

To find the number of twos in 8!8!:

  • Multiples of 21=22^1 = 2:

    • Numbers: 2,4,6,82, 4, 6, 8

    • Count: 8/2=4\lfloor 8/2 \rfloor = 4

  • Multiples of 22=42^2 = 4:

    • Numbers: 4,84, 8

    • Count: 8/4=2\lfloor 8/4 \rfloor = 2

  • Multiples of 23=82^3 = 8:

    • Numbers: 88

    • Count: 8/8=1\lfloor 8/8 \rfloor = 1

  • Multiples of 24=162^4 = 16:

    • Numbers: None (since 16 > 8)

    • Count: 8/16=0\lfloor 8/16 \rfloor = 0

  • Total Number of Twos: 4+2+1+0=74 + 2 + 1 + 0 = 7

    • The correct answer is 77.

Example 2: Finding Threes in 15!15!

To find the number of threes in 15!15!:

  • Multiples of 31=33^1 = 3:

    • Numbers: 3,6,9,12,153, 6, 9, 12, 15

    • Count: 15/3=5\lfloor 15/3 \rfloor = 5

  • Multiples of 32=93^2 = 9:

    • Numbers: 99

    • Count: 15/9=1\lfloor 15/9 \rfloor = 1

  • Multiples of 33=273^3 = 27:

    • Numbers: None (since 27 > 15)

    • Count: 15/27=0\lfloor 15/27 \rfloor = 0

  • Total Number of Threes: 5+1+0=65 + 1 + 0 = 6

Example 3: Finding Fives in 50!50!

This method is especially useful for larger factorials where listing out numbers is impractical.

  • Multiples of 51=55^1 = 5:

    • Count: 50/5=10\lfloor 50/5 \rfloor = 10

  • Multiples of 52=255^2 = 25:

    • Count: 50/25=2\lfloor 50/25 \rfloor = 2

    • (Numbers: 25,5025, 50)

  • Multiples of 53=1255^3 = 125:

    • Count: 50/125=0\lfloor 50/125 \rfloor = 0

  • Total Number of Fives: 10+2+0=1210 + 2 + 0 = 12

Application Problem: Maximum Exponent

Question: If 30!3x\frac{30!}{3^x} is an integer, what is the maximum value of xx?

  • Rephrasing the question: This question is equivalent to asking: "How many threes are there in 30!30!?"

  • Applying the system for 30!30! and prime 33:

    • Multiples of 31=33^1 = 3:

      • Count: 30/3=10\lfloor 30/3 \rfloor = 10

      • (Numbers: 3,6,9,12,15,18,21,24,27,303, 6, 9, 12, 15, 18, 21, 24, 27, 30)

    • Multiples of 32=93^2 = 9:

      • Count: 30/9=3\lfloor 30/9 \rfloor = 3

      • (Numbers: 9,18,279, 18, 27)

    • Multiples of 33=273^3 = 27:

      • Count: 30/27=1\lfloor 30/27 \rfloor = 1

      • (Numbers: 2727)

    • Multiples of 34=813^4 = 81:

      • Count: 30/81=0\lfloor 30/81 \rfloor = 0

  • Total Number of Threes: 10+3+1+0=1410 + 3 + 1 + 0 = 14

  • Conclusion: The maximum value of xx is 1414.