title: Fast Prime Factorization Algorithm
body: <p>I'm writing a code in C that returns the number of times a positive integer can be expressed as sums of perfect squares of two positive integers.</p>
  
  <pre><code>R(n) is the number of couples (x,y) such that x² + y² = n where x, y, n are all 
  non negative integers.
  </code></pre>
  
  <p>To compute R(n), I need to first find the prime factorization of n.</p>
  
  <p>The problem is that I've tried a lot of algorithm for prime factorization that I can use on C but I need my code to be as fast as possible, so I would appreciate it if anyone can give me what he/she considers as the fastest algorithm to compute the prime factorization of a number as large as <code>2147483742.</code></p>