Prev: Exporting equations as high-quality graphics
Next: Trouble with coupled quadratic equations where the solutions are
From: Artur on 13 Mar 2010 07:57 Dear Mathematica Gurus Who know how write procedure which will be do brutal force stop FactorInteger after defined time (e.g. 30 second) but results finded up to 30 second should be listed Best wishes Artur Option Automatic need about 75 second to stop Timing[fax = FactorInteger[ 1111111111111111111111111111111111111111111111111111111111111111111\ 1111111111111111111111111111111111111111111111111111111111111111111111\ 1111111111111111111111111111111111111111111111111111111111111111111111\ 11111111111111111111111111111111111119, Automatic]]
From: Bob Hanlon on 14 Mar 2010 06:16 use TimeConstrained Bob Hanlon ---- Artur <grafix(a)csl.pl> wrote: ============= Dear Mathematica Gurus Who know how write procedure which will be do brutal force stop FactorInteger after defined time (e.g. 30 second) but results finded up to 30 second should be listed Best wishes Artur Option Automatic need about 75 second to stop Timing[fax = FactorInteger[ 1111111111111111111111111111111111111111111111111111111111111111111\ 1111111111111111111111111111111111111111111111111111111111111111111111\ 1111111111111111111111111111111111111111111111111111111111111111111111\ 11111111111111111111111111111111111119, Automatic]]
From: Scott Hemphill on 18 Mar 2010 05:32 Artur <grafix(a)csl.pl> writes: > Dear Mathematica Gurus > Who know how write procedure which will be do brutal force stop > FactorInteger after defined time (e.g. 30 second) but results finded up > to 30 second should be listed > Best wishes > Artur > > Option Automatic need about 75 second to stop > > Timing[fax = > FactorInteger[ > 1111111111111111111111111111111111111111111111111111111111111111111\ > 1111111111111111111111111111111111111111111111111111111111111111111111\ > 1111111111111111111111111111111111111111111111111111111111111111111111\ > 11111111111111111111111111111111111119, Automatic]] I believe that large integer is x = (10^245+71)/9. If you let FactorInteger[x, 2] run long enough, you find out that x is divisble by 24164822890633570718420181256194871. Scott -- Scott Hemphill hemphill(a)alumni.caltech.edu "This isn't flying. This is falling, with style." -- Buzz Lightyear
From: Daniel Lichtblau on 19 Mar 2010 03:39
Scott Hemphill wrote: > Artur <grafix(a)csl.pl> writes: > >> Dear Mathematica Gurus >> Who know how write procedure which will be do brutal force stop >> FactorInteger after defined time (e.g. 30 second) but results finded up >> to 30 second should be listed >> Best wishes >> Artur >> >> Option Automatic need about 75 second to stop >> >> Timing[fax = >> FactorInteger[ >> 1111111111111111111111111111111111111111111111111111111111111111111\ >> 1111111111111111111111111111111111111111111111111111111111111111111111\ >> 1111111111111111111111111111111111111111111111111111111111111111111111\ >> 11111111111111111111111111111111111119, Automatic]] > > I believe that large integer is x = (10^245+71)/9. > > If you let FactorInteger[x, 2] run long enough, you find out that x is > divisble by 24164822890633570718420181256194871. > > Scott This gives the basic idea for how to do what was wanted. Wrap repeated calls of FactorInteger[..., 2] inside a TimeConstrained[loop,time,failexpr], keeping track of all factors found, which are PrimeQ, (so as to further attempt to factor those that are not). Put the ones found in failexpr. When time finally elapses, they get returned. if you fully factor the number before time expires, return factors the usual way. Daniel Lichtblau Wolfram Research |