title: What is the fastest integer factorization algorithm?
body: <p>I've written a program that attempts to find Amicable Pairs.  This requires finding the sums of the proper divisors of numbers.</p>
  
  <p>Here is my current <code>sumOfDivisors()</code> method:</p>
  
  <pre class="lang-c prettyprint-override"><code>int sumOfDivisors(int n)
  {  
      int sum = 1;
      int bound = (int) sqrt(n);
      for(int i = 2; i &lt;= 1 + bound; i++)
      {
          if (n % i == 0)
              sum = sum + i + n / i;
      } 
      return sum;
  }
  </code></pre>
  
  <p>So I need to do lots of factorization and that is starting to become the real bottleneck in my application.  I typed a huge number into MAPLE and it factored it insanely fast.  </p>
  
  <p>What is one of the faster factorization algorithms?</p>