title: Coprime Factorization in Python
body: <p>I have to write a code to find the two highest co prime factors of an entered number, 10^num.</p>
  
  <p>Right now, I've written:</p>
  
  <pre><code>def coprimes(num):
      for x in range (2, num):
          for y in range (2, num):
              while (gcd(x,y) == 1) &amp; (x != y):
                  if (x*y==num):
                      return (x,y)
  </code></pre>
  
  <p>Which is obviously a really slow program because of the forloops. Whenever I enter it into the terminal, it's too slow to produce an answer. I'm also not sure if this is correct. Do you have any suggestions on how I could improve this method? </p>
  
  <p>An example answer of this method should be:</p>
  
  <pre><code>&gt;&gt;&gt; coprimes(10)
  (9765625, 1024)
  </code></pre>