title: What is the fastest way to find divisor of any bigInteger in c#
body: <p>I want to run something like below code so that i would be able to find a divisor for numbers of ~30-40 length without having to check millions of possibilities even up to their square root.
  What is the fastest possible solution to find a legitimate non trivial divisor of a number or how can i improve below code to run faster, without having to loop through all possible options.</p>
  
  <pre><code>    static int divisor(string numberToCheck)
      {
          BigInteger n = BigInteger.Parse(numberToCheck);
          BigInteger sqrt = Sqrt(n);
          if (n % 2 == 0)
              return 2;
          for (UInt64 = 3; i &lt;= sqrt; i+=2)
          {
              if (n % i == 0)
                  return i;
          }
          return -1;
      }
  </code></pre>