![]() |
![]() |
#1 | ||
"James Heinrich"
May 2004
ex-Northern Ontario
3·1,087 Posts |
![]()
I'm looking for a simple *nix program to factor P-1 factors (which, most of the time, will confirm that they're prime). So relatively small numbers, typically under 150 bits. I want something like:
Quote:
Quote:
|
||
![]() |
![]() |
![]() |
#2 |
Sep 2002
Database er0rr
37·97 Posts |
![]()
echo "factor(17613769033772007210894662109212994801791)" | gp -q
[74835908771936093401 1] [235365205324763482391 1] ![]() You could set up an alias with a parameter. Also you could tweak the output. Do any gurus want to give a solution? Last fiddled with by paulunderwood on 2011-08-26 at 13:08 |
![]() |
![]() |
![]() |
#3 | |
Bamboozled!
"πΊππ·π·π"
May 2003
Down not across
295B16 Posts |
![]() Quote:
GMP-ECM 6.2.2 [powered by GMP 4.3.1] [ECM] Input number is 17613769033772007210894662109212994801791 (41 digits) Using B1=1000000, B2=1045563762, polynomial Dickson(6), sigma=816405928 Step 1 took 1183ms Step 2 took 990ms ********** Factor found in step 2: 74835908771936093401 Found probable prime factor of 20 digits: 74835908771936093401 Probable prime cofactor 235365205324763482391 has 21 digits [pcl@anubis PROCESS]$ Paul |
|
![]() |
![]() |
![]() |
#4 |
"James Heinrich"
May 2004
ex-Northern Ontario
3×1,087 Posts |
![]()
Please go on the assumption that my *nix knowledge is nonexistant, you won't be far off...
![]() Code:
$ echo "factor(17613769033772007210894662109212994801791)" | gp -q -bash: gp: command not found -bash: echo: write error: Broken pipe Code:
$ echo "17613769033772007210894662109212994801791" | ecm -c 100 1000000 -bash: ecm: command not found -bash: echo: write error: Broken pipe Last fiddled with by James Heinrich on 2011-08-26 at 13:13 |
![]() |
![]() |
![]() |
#5 |
Sep 2002
Database er0rr
37·97 Posts |
![]()
-bash: gp: command not found
install pari-gp ![]() I edited ~/.bashrc and added this as the last line Code:
factro () { echo "factor($*)" | gp -q; } Code:
factro 7100001 [3 3] [59 1] [4457 1] ![]() Last fiddled with by paulunderwood on 2011-08-26 at 13:43 |
![]() |
![]() |
![]() |
#6 |
"James Heinrich"
May 2004
ex-Northern Ontario
326110 Posts |
![]()
Unfortunately my *nix-competance extends as far as beginner-level expertise with the commands "cd" and "ls", and not much beyond that.
![]() (and it's a production webserver that I don't want to play with too much at risk of breaking things) However, I have recently (yes, since posting...) that my server does in fact support PHP-gmp, and my PHP skills are considerably better, so I'll stick to hacking it out that way ![]() |
![]() |
![]() |
![]() |
#7 |
Tribal Bullet
Oct 2004
2·3·19·31 Posts |
![]()
Check the sticky in the factoring subforum here for links to many programs that can do what you want. On unix, though, you'll probably have to compile them.
|
![]() |
![]() |
![]() |
#8 |
Bamboozled!
"πΊππ·π·π"
May 2003
Down not across
245338 Posts |
![]() |
![]() |
![]() |
![]() |
#9 |
"James Heinrich"
May 2004
ex-Northern Ontario
3·1,087 Posts |
![]()
I may have to do that. I picked yafu at random and tried, and failed, ending up with:
Code:
[ yafu-1.28.4]$ make x86 gcc -g -O3 -fomit-frame-pointer -Wall -I. -Iinclude -m32 -c -o arith/tfm/fp_mul_comba.o arith/tfm/fp_mul_comba.c In file included from include/tfm.h:18, from arith/tfm/fp_mul_comba.c:18: include/yafu.h:49:17: error: gmp.h: No such file or directory In file included from include/tfm.h:19, from arith/tfm/fp_mul_comba.c:18: include/arith.h:170: error: expected ')' before 'src' include/arith.h:171: error: expected ')' before 'dest' make: *** [arith/tfm/fp_mul_comba.o] Error 1 |
![]() |
![]() |
![]() |
#10 | |
Sep 2009
7D116 Posts |
![]() Quote:
"man" has it's own man page (type "man man" to read it) and "man intro" gives a relatively gentle introduction to Linux. I often have 1 window to enter commands and another to read the man page for the command I'm using. Even experts don't want to to guess when using commands like fsck. Chris K. |
|
![]() |
![]() |
![]() |
#11 |
"James Heinrich"
May 2004
ex-Northern Ontario
3×1,087 Posts |
![]()
man pages are fine to know what a certain command does, but are not all that useful in solving compile-time errors.
|
![]() |
![]() |
![]() |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Mail from command line | pepi37 | Linux | 4 | 2015-07-16 22:06 |
Windows command line | mu5tan6 | Software | 14 | 2015-03-20 17:21 |
command line switch | wongnog | Information & Answers | 1 | 2008-07-20 11:29 |
NewPGen from the command line | monst | Software | 19 | 2008-01-31 07:07 |
A small factoring program | Yamato | Factoring | 2 | 2007-11-21 23:29 |