mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   PARI/GP (https://www.mersenneforum.org/forumdisplay.php?f=155)
-   -   PARI's commands (https://www.mersenneforum.org/showthread.php?t=13636)

CRGreathouse 2010-08-19 14:22

[QUOTE=3.14159;226148]The odds of finding something:

Normally: 1 in about 44000.

Potential prime factors eliminated: first 125 primes:
Leaving it at about 1 in 3750. (w/no sieving)[/QUOTE]

Yes, the only savings of sieving is that it's faster than trial division, so you can either spend the same amount of time and reduce the number of candidates (by removing the first million primes, say) or you can remove just as many, but faster.

Trial division by 125 primes costs 125 modular divisions, at a cost of maybe 1000 cycles each. For a list of N candidates, this costs 1000N cycles in total. With sieving, the first is just as slow as trial division, maybe slightly slower, but the rest cost almost nothing (about 3 cycles in this case), for a total cost of about 1000 + 3N cycles.

CRGreathouse 2010-08-19 14:23

[QUOTE=science_man_88;226151]CRG if you're sick take a rest or Questions will make you worse.[/QUOTE]

Thanks for your concern. :smile:

I'm not entirely better, but I'm almost there. Yesterday I had to take the day off work (well, half the day at least) I was so bad. :yucky:

3.14159 2010-08-19 14:24

[QUOTE=CRGreathouse]Four -- the code should probably just start at 2 or 3 for the prime range. All you need to add in terms of arguments is the n.
[/QUOTE]

The next time around: Please, don't make a sieve script that depends on me holding the "cancel" button to work efficiently.

CRGreathouse 2010-08-19 14:33

[QUOTE=3.14159;226154]The next time around: Please, don't make a sieve script that depends on me holding the "cancel" button to work efficiently.[/QUOTE]

I don't know what this means.

3.14159 2010-08-19 14:36

[QUOTE=CRGreathouse]I don't know what this means.[/QUOTE]

When I leave it be, it works rather slowly; When I hold the cancel command, or the copy command (Ctrl + C) it works like a charm.

CRGreathouse 2010-08-19 14:41

If you break (Ctrl+C) then it stops immediately, not finishing the computation. It's useful if you run a program with the settings too high -- you can stop it, change the settings lower, and re-run.

3.14159 2010-08-19 14:51

[QUOTE=CRGreathouse]If you break (Ctrl+C) then it stops immediately, not finishing the computation. It's useful if you run a program with the settings too high -- you can stop it, change the settings lower, and re-run.
[/QUOTE]

Hey: Can you make the substitutions/modifications or give a hint of where they belong? I'm unable to do this myself, as I posted before, far outside of my command knowledge.

The only substitution I've been able to make is the variables.

science_man_88 2010-08-19 14:59

couldn't you have gettime() called every few calculations and then ask if it's above a limit abort().

CRGreathouse 2010-08-19 15:03

[QUOTE=3.14159;226162]Hey: Can you make the substitutions/modifications or give a hint of where they belong? I'm unable to do this myself, as I posted before, far outside of my command knowledge.

The only substitution I've been able to make is the variables.[/QUOTE]

You should study it to see how it uses the vector, since you seem to have trouble there, then use the code I/we worked out earlier for the variable-k case -- Mod(-1,p)/stuff.

CRGreathouse 2010-08-19 15:04

[QUOTE=science_man_88;226163]couldn't you have gettime() called every few calculations and then ask if it's above a limit abort().[/QUOTE]

I wouldn't want to. What if I need it to run for a long time, e.g. for a few weeks? I'm running a project like that now.

3.14159 2010-08-19 15:12

[QUOTE=CRGreathouse]You should study it to see how it uses the vector, since you seem to have trouble there, then use the code I/we worked out earlier for the variable-k case -- Mod(-1,p)/stuff.
[/QUOTE]

So I should revert back to Liftmodm1/em2/mem?


All times are UTC. The time now is 23:06.

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