Sharedsupport / 2015-05-15-124943-factor-hao.sagewsOpen in CoCalc
Authors: Harald Schilly, ℏal Snyder, William A. Stein
License: GNU General Public License v3.0
Description: Examples for support purposes.
n = 52888482081849692996246359529461423440516110852332749451495890998035396834490590769983263132497856053944322007386450477676459040092729755699139868022596753636188355252404399834322984889445433290551665893010423894854933418262461617242262365324578684791241
a2feca2d-67e4-4981-876b-964863242eafs N(log(n,2))
842.850761576618
trial_division(n,bound=10^8)
52888482081849692996246359529461423440516110852332749451495890998035396834490590769983263132497856053944322007386450477676459040092729755699139868022596753636188355252404399834322984889445433290551665893010423894854933418262461617242262365324578684791241
%time ecm.find_factor(n, factor_digits=10)
[73023785457243171298343241075948961, 724263768999169659619469570920896803547851460097652036523459795375502746982720498826215799677150708859171451649355039855792537644930646924185166402462227715774302402745558754682167647487748351903600589577482663287581481] CPU time: 0.02 s, Wall time: 14.17 s
p = 73023785457243171298343241075948961 m = 724263768999169659619469570920896803547851460097652036523459795375502746982720498826215799677150708859171451649355039855792537644930646924185166402462227715774302402745558754682167647487748351903600589577482663287581481
p*m == n
True
is_prime(m)
False
is_prime(p)
False
factor(p)
270229135100645969^2
N(log(m,2))
727.036839892318
%time ecm.find_factor(m, factor_digits=10)
Error in lines 1-1 Traceback (most recent call last): File "/projects/4a5f0542-5873-4eed-a85c-a18c706e8bcd/.sagemathcloud/sage_server.py", line 879, in execute exec compile(block+'\n', '', 'single') in namespace, locals File "", line 1, in <module> File "/usr/local/sage/sage-6.5/local/lib/python2.7/site-packages/sage/interfaces/ecm.py", line 559, in find_factor factors = self._find_factor(n, factor_digits, B1, **kwds) File "/usr/local/sage/sage-6.5/local/lib/python2.7/site-packages/sage/interfaces/ecm.py", line 509, in _find_factor out = self._run_ecm(cmd, n) File "/usr/local/sage/sage-6.5/local/lib/python2.7/site-packages/sage/interfaces/ecm.py", line 216, in _run_ecm out, err = p.communicate(input=str(n)) File "/usr/local/sage/sage-6.5/local/lib/python/subprocess.py", line 799, in communicate return self._communicate(input) File "/usr/local/sage/sage-6.5/local/lib/python/subprocess.py", line 1401, in _communicate stdout, stderr = self._communicate_with_poll(input) File "/usr/local/sage/sage-6.5/local/lib/python/subprocess.py", line 1455, in _communicate_with_poll ready = poller.poll() File "sage/ext/c_lib.pyx", line 176, in sage.ext.c_lib.sage_python_check_interrupt (build/cythonized/sage/ext/c_lib.c:1683) sig_check() File "sage/ext/c_lib.pyx", line 73, in sage.ext.c_lib.sig_raise_exception (build/cythonized/sage/ext/c_lib.c:769) raise KeyboardInterrupt KeyboardInterrupt
CPU time: 0.08 s, Wall time: 198.60 s