mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   Information & Answers (https://www.mersenneforum.org/forumdisplay.php?f=38)
-   -   any suitable sieve written in C or Python? (https://www.mersenneforum.org/showthread.php?t=21896)

Shen 2017-01-05 03:16

any suitable sieve written in C or Python?
 
It is well known that if q | 2^p - 1, then q = 2px + 1 and q = 8r +(-) 1.

when I do some research on Fp (Fibonacci prime), I guess :
1: if q | Fp, then q = 2px + (-1)^x
2: F(2n+1) must have a prime factor q, q = 2(2n+1)x + (-1)^x
3: ...

At this moment , I try to factor C261 ( F1565 = F5* F313 * C261), which has 261 digital. If guess is right, then C261 must have a prime factor = 2*1565*x + (-1)^x.

The GIMPS factoring code creates a modified sieve of Eratosthenes with each bit representing a potential 2kp+1 factor. The sieve then eliminates any potential factors that are divisible by prime numbers below 40,000 or so. Also, bits representing potential factors of 3 or 5 mod 8 are cleared. This process eliminates roughly 95% of potential factors.

Since I don't know assemble language, I could not understand such code.
I tried to code it by myself, but the code efficiency is very low.

I have no other good choice but ask for help :
Could someone provide a efficient sieve ?

Thanks a lot!

carpetpool 2017-01-05 04:19

Didn't you get the idea from[URL="http://mersenneforum.org/showthread.php?p=450501#post450501"] here[/URL]?

axn 2017-01-05 04:34

[QUOTE=Shen;450498]At this moment , I try to factor C261 ( F1565 = F5* F313 * C261), which has 261 digital. If guess is right, then C261 must have a prime factor = 2*1565*x + (-1)^x.[/QUOTE]

Trial factoring is the wrong tool for numbers this size. You should use ECM.

carpetpool 2017-01-05 04:42

[QUOTE=axn;450503]Trial factoring is the wrong tool for numbers this size. You should use ECM.[/QUOTE]

[URL="https://sourceforge.net/projects/yafu/"]YAFU[/URL]?

Shen 2017-01-05 04:49

Thanks for your advice.


All times are UTC. The time now is 04:37.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.