mersenneforum.org  

Go Back   mersenneforum.org > Math Stuff > Computer Science & Computational Number Theory > PARI/GP

Reply
 
Thread Tools
Old 2010-08-19, 14:22   #661
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

175B16 Posts
Default

Quote:
Originally Posted by 3.14159 View Post
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)
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 is offline   Reply With Quote
Old 2010-08-19, 14:23   #662
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

3·1,993 Posts
Default

Quote:
Originally Posted by science_man_88 View Post
CRG if you're sick take a rest or Questions will make you worse.
Thanks for your concern.

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.
CRGreathouse is offline   Reply With Quote
Old 2010-08-19, 14:24   #663
3.14159
 
3.14159's Avatar
 
May 2010
Prime hunting commission.

24·3·5·7 Posts
Default

Quote:
Originally Posted by 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.
The next time around: Please, don't make a sieve script that depends on me holding the "cancel" button to work efficiently.
3.14159 is offline   Reply With Quote
Old 2010-08-19, 14:33   #664
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

175B16 Posts
Default

Quote:
Originally Posted by 3.14159 View Post
The next time around: Please, don't make a sieve script that depends on me holding the "cancel" button to work efficiently.
I don't know what this means.
CRGreathouse is offline   Reply With Quote
Old 2010-08-19, 14:36   #665
3.14159
 
3.14159's Avatar
 
May 2010
Prime hunting commission.

24×3×5×7 Posts
Default

Quote:
Originally Posted by CRGreathouse
I don't know what this means.
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.

Last fiddled with by 3.14159 on 2010-08-19 at 14:36
3.14159 is offline   Reply With Quote
Old 2010-08-19, 14:41   #666
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

3·1,993 Posts
Default

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.
CRGreathouse is offline   Reply With Quote
Old 2010-08-19, 14:51   #667
3.14159
 
3.14159's Avatar
 
May 2010
Prime hunting commission.

24·3·5·7 Posts
Default

Quote:
Originally Posted by 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.
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.

Last fiddled with by 3.14159 on 2010-08-19 at 14:51
3.14159 is offline   Reply With Quote
Old 2010-08-19, 14:59   #668
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26×131 Posts
Default

couldn't you have gettime() called every few calculations and then ask if it's above a limit abort().
science_man_88 is offline   Reply With Quote
Old 2010-08-19, 15:03   #669
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

175B16 Posts
Default

Quote:
Originally Posted by 3.14159 View Post
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.
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 is offline   Reply With Quote
Old 2010-08-19, 15:04   #670
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

3·1,993 Posts
Default

Quote:
Originally Posted by science_man_88 View Post
couldn't you have gettime() called every few calculations and then ask if it's above a limit abort().
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.
CRGreathouse is offline   Reply With Quote
Old 2010-08-19, 15:12   #671
3.14159
 
3.14159's Avatar
 
May 2010
Prime hunting commission.

24·3·5·7 Posts
Default

Quote:
Originally Posted by 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.
So I should revert back to Liftmodm1/em2/mem?

Last fiddled with by 3.14159 on 2010-08-19 at 15:13
3.14159 is offline   Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Why do I sometimes see all the <> formatting commands when I quote or edit? cheesehead Forum Feedback 3 2013-05-25 12:56
Passing commands to PARI on Windows James Heinrich Software 2 2012-05-13 19:19
Ubiquity commands Mini-Geek Aliquot Sequences 1 2009-09-22 19:33
64-bit Pari? CRGreathouse Software 2 2009-03-13 04:22
Are these commands correct? jasong Linux 2 2007-10-18 23:40

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


Fri Aug 6 23:03:57 UTC 2021 up 14 days, 17:32, 1 user, load averages: 3.59, 3.88, 3.93

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

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.