Fastest tweetable integer factorizer The task is to find a non-trivial factor of a composite number.

Write code that finds a non-trivial factor of a composite number as quickly as possible subject to your code being no more than 140 bytes long.  The output should just be the factor you have found.

Your code can take input and give output in any way that is convenient including for example as arguments to a function.

Test cases which list all the factors (you only need to output  one)

187: 11 17
1679: 23 73
14369648346682547857: 1500450271 9576890767
34747575467581863011: 3628273133 9576890767
52634041113150420921061348357: 2860486313 5463458053 3367900313
82312263010898855308580978867: 264575131106459 311111111111113
205255454905325730631914319249: 2860486313 71755440315342536873 
1233457775854251160763811229216063007: 1110111110111 1000000000063 1111111999999
1751952685614616185916001760791655006749: 36413321723440003717 48112959837082048697


I won't score your answer on the following difficult test case which may be of interest for testing:

513231721363284898797712130584280850383: 40206835204840513073 12764787846358441471


Score

Your score is the combined time to factor all the test cases above with a penalty of 10 minutes for each failed factorization (all rounded to the nearest second).  Your code should work for other integers too, that is shouldn't just hardcode these answers.

I will stop your code after 10 minutes.

If two people get the same score then the first answer wins.

Restrictions

Your code can't use any builtin or library function that performs integer factorization. You can assume the input takes less than 256 bits.  All input numbers will be composite.

How will I time?

I will literally run time ./myprog on my Ubuntu system  to do the timing so please also supply a complete program for me to run that includes any function you have defined.

A note for compiled languages

Compilation time must take no more than 1 minute on my machine.

Is it actually possible?

If you ignore the space constraints, then  each one can be factored in less than 2 seconds on my computer using pure Python code + pypy.

So what is a non-trivial factoring algorithm?

Pollard's rho algorithm is fast and suitable for golfing. Of course there are plenty of other ways to factor an integer as well.

Even faster is the Quadratic sieve.  It looks like a serious challenge to squeeze that into 140 bytes.

Leading scores


SEJPM, 10 minutes penalty for the last test case + 16 seconds in Haskell
Haskell, 100 97 91 89 87 72 67 Bytes
Try It Online!
-3 bytes thanks to @flawr
-6 bytes thanks to @flawr again
-2 bytes thanks to @flawr yet again
-2 bytes thanks to an optimized set of parameters
-1 byte thanks to @flawrs yet another time
-14 bytes thanks to requirement to only having to output one factor
-5 bytes thanks to @AndersKaseorg
f n|let s x=mod(x*x+7)n;a#b|d&lt;-gcd(b-a)n,d&gt;1=d|c&lt;-s b=s a#s c=5#s 5

This works for the first 5 test cases in unnoticable time.
This will probably time-out on the largest test case.
In general this will usually return one non-trivial factor in time proportional to the square root of the smallest factor.
It will not work on every input because it doesn't vary the polynomial and detection of the exceptional case is hard to do in 140 bytes.
It will also not output the full factorization, but rather a non-trivial factor and the division of the input by this factor.
It will also not sort the factors by size.
The method used is Pollard-Rho-Factoring with the standard starting value of 2 (with the standard x^2+1 polynomial applied once) and the non-standard polynomial constant factor of 7 (because 1 didn't work with 1679) for all further evaluations.
Full program (factor.hs):
import System.Environment(getArgs)

f n|let s x=mod(x*x+7)n;a#b|d&lt;-gcd(b-a)n,d&gt;1=d|c&lt;-s b=s a#s c=5#s 5

main= do
      args &lt;- getArgs
      print$f (read $ head args :: Integer)

Compile as $ ghc factor.hs (needs ghc installed).
Run as $ ./factor &lt;number&gt;.
Example run:
$ ./factor 187
11


Ungolfed code:
f n=g 5 (s 5)
   where s x=mod(x*x+7)n
         g a b = if d&gt;1 then d else g(s a)(s(s b))
               where d=gcd(b-a)n

Computes the non-trivial factor by calling g with initial values. The polynomial is pre-applied on 2 here and re-applied on the result (5) so that the input to g (in a &quot;where&quot; clause) can always be readily used for the gcd-test. g (golfed version uses infix #) then tries to compute a non-trivial factor d (in the where clause in the un-golfed version, in-line in the golfed one) as the difference between the two inputs to g, if it succeeds returns said factor, else retries. Here it may generate n as the output if a==b and thus returns only a trivial factor, the proper approach to handle this would be to either vary the starting values upon this event or change the polynomial.