title: Prime factorization of a factorial
body: <p>I need to write a program to input a number and output its factorial's prime factorization  in the form:</p>
  
  <pre><code>4!=(2^3)*(3^1)
  
  5!=(2^3)*(3^1)*(5^1)
  </code></pre>
  
  <p>The problem is I still can't figure out how to get that result.</p>
  
  <p>Apparently each first number in brackets is for the ascending prime numbers up until the actual factorial. The second number in brackets is the amount of times the number occurs in the factorial.</p>
  
  <p>What I can't figure out is for example in <code>5!=(2^3)*(3^1)*(5^1)</code>, how does 2 only occur 3 times, 3 only 1 time and 5 only one time in 120 (5!=120).</p>
  
  <p>I have now solved this thanks to the helpful people who commented but I'm now having trouble trying to figure out how could I take a number and get the factorial in this format without actually calculating the factorial.</p>