Quote:
Originally Posted by kruoli
Yes! If it finds the number itself:
Code:
~$ echo 2047  ecm one 1000
GMPECM 7.0.4 [configured with GMP 6.2.0, enableasmredc] [ECM]
Input number is 2047 (4 digits)
Using B1=1000, B2=51606, polynomial x^1, sigma=1:2307810929
Step 1 took 1ms
********** Factor found in step 1: 2047
Found input number N
~$ echo $?
8
If it finds a factor and the cofactor is prime (maybe PRP):
Code:
~$ echo 2047  ecm one 1
GMPECM 7.0.4 [configured with GMP 6.2.0, enableasmredc] [ECM]
Input number is 2047 (4 digits)
Using B1=1, B2=12, polynomial x^1, sigma=1:309160743
Step 1 took 0ms
Step 2 took 0ms
********** Factor found in step 2: 23
Found prime factor of 2 digits: 23
Prime cofactor 89 has 2 digits
~$ echo $?
14
If it finds a factor and the cofactor is composite:
Code:
~$ echo '2*(2^20471)'  ecm one 1
GMPECM 7.0.4 [configured with GMP 6.2.0, enableasmredc] [ECM]
Input number is 2*(2^20471) (617 digits)
********** Factor found in step 1: 2
Found prime factor of 1 digits: 2
Composite cofactor (2*(2^20471))/2 has 617 digits
~$ echo $?
6
I'd have to look into the code if there are other possibilities.

Interesting. Thank you for the reply.
I was looking for a way to incorporate this into a Windows batch file. Below is an example:
Quote:
echo "2^18611"  ecm c 100 v one 3 1e6
if %errorlevel% neq 0 goto errhandler

In this case,
neq is "not equal to." Knowing the specific return value is not really necessary. The three examples above demonstrate that
one also works in a nonlooping mode. I was wondering about this.