![]() |
|
|
#606 |
|
May 2010
Prime hunting commission.
24·3·5·7 Posts |
I defined the function em2 to return b-values that are divisible by a user-specified number.
I thought of a new function that gets rid of the b-values divisible by any prime in a range of primes. simply save these to a file, remove every duplicate, remove the b-values from the range that happen to be divisible by p, and test the remainder. It's already defined. To make it somewhat better: I'm going to need a further command that prints the numbers that are not in the set of em2 for any of the primes specified. The primelimit is set to 2147483648, so it's going to be somewhat useful. Excellent idea, amirite? Last fiddled with by 3.14159 on 2010-08-17 at 15:46 |
|
|
|
|
|
#607 |
|
May 2010
Prime hunting commission.
24×3×5×7 Posts |
The code snippet I scribbled on paper for the next command:
nonmem(a,x,m,b) = { for(n=a,x, if(n=!mem(a,x,m,b), print(n)) ); } (Please tell whether or not there are any errors there.) For mem: mem(a,x,m,b) = { forprime(p=a,x, print(em2(p,m!,b)) ); } (Where b = 10b). Last fiddled with by 3.14159 on 2010-08-17 at 15:53 |
|
|
|
|
|
#608 |
|
Aug 2006
3·1,993 Posts |
I'm sure I scanned that portion of the code at least two or three times, but it wasn't clear that there was anything wrong. (The other parts where I thought the problem was I looked at a dozen times at least... although that did help me optimize those parts.)
In any case that project is running now. It's about 100 times faster than my old version at these sizes, and should be about 1000 times faster as the numbers grow large. I'm still actively looking to optimize the program -- I'm hoping for at least a 20% improvement, maybe a 50% improvement if I missed something big. But compared to the improvements I already have that's peanuts. |
|
|
|
|
|
#609 | ||
|
May 2010
Prime hunting commission.
24·3·5·7 Posts |
Quote:
Quote:
Last fiddled with by 3.14159 on 2010-08-17 at 15:59 |
||
|
|
|
|
|
#610 | |
|
Aug 2006
3×1,993 Posts |
Quote:
|
|
|
|
|
|
|
#611 |
|
Aug 2006
175B16 Posts |
|
|
|
|
|
|
#612 | |
|
May 2010
Prime hunting commission.
24×3×5×7 Posts |
Quote:
Also: Anything regarding the code snippets I thought up a few minutes ago? Last fiddled with by 3.14159 on 2010-08-17 at 16:05 |
|
|
|
|
|
|
#613 | ||
|
Aug 2006
3×1,993 Posts |
Quote:
Quote:
Printing is bad, don't do it if you can avoid it.
|
||
|
|
|
|
|
#614 | |
|
May 2010
Prime hunting commission.
24×3×5×7 Posts |
Quote:
Last fiddled with by 3.14159 on 2010-08-17 at 16:13 |
|
|
|
|
|
|
#615 | |
|
May 2010
Prime hunting commission.
69016 Posts |
Quote:
|
|
|
|
|
|
|
#616 | |
|
Aug 2006
175B16 Posts |
Quote:
Not really important here. The best of all the easy solutions in Pari is to use a VECSMALL, which is created by vectorsmall just like a VEC is created by vector. |
|
|
|
|
![]() |
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 |