![]() |
|
|
#617 |
|
May 2010
Prime hunting commission.
24×3×5×7 Posts |
In the long run, my idea fails, because nonmem fails to work as directed. I think I'm going to have to revert back to the TF switch on PFGW.
Last idea: if(n=!p*a + lift(Mod(-1,p)/(m!)), print(n))) Last fiddled with by 3.14159 on 2010-08-17 at 16:46 |
|
|
|
|
|
#618 |
|
May 2010
Prime hunting commission.
24·3·5·7 Posts |
Well, it works, but only for individual divisors. If I add more than one prime, it loops/repeats. I need to edit it to include the and condition a few hundred times.
Last fiddled with by 3.14159 on 2010-08-17 at 16:56 |
|
|
|
|
|
#619 |
|
Aug 2006
3×1,993 Posts |
As you will. For my recent (ongoing, unfortunately) project I found a huge speedup with sieving vs. trial division: I could remove more composites (higher bounds) in less time with sieving. Actually I found it worthwhile to spend a good fraction of my time sieving because of the amount of effort saved by avoiding primality tests.
|
|
|
|
|
|
#620 |
|
Aug 2006
3·1,993 Posts |
You need to store the results in a vector rather than printing, since your lists will get large. For my small project I had 2 million candidates and 100 million primes; yours may not be as small. (I hoped to finish this yesterday so as to free up cycles for my new project that I've talked about, but no such luck.)
|
|
|
|
|
|
#621 | |
|
May 2010
Prime hunting commission.
24·3·5·7 Posts |
Quote:
Ex: Sieving out 509 for k * 360! + 1: Liftmod(509, 360!) = 474. Suppose the k-value range is n between 1 and 60k. That would be 117 values removed. Manual removal of values is dreadfully inefficient. Last fiddled with by 3.14159 on 2010-08-17 at 17:08 |
|
|
|
|
|
|
#622 | |
|
Aug 2006
3·1,993 Posts |
Quote:
There's no need to use an intermediate file, I don't know why you'd suggest that. You keep one vector that starts out all 0s, you sieve, and at the end of the process each remaining 0 corresponds to a candidate which is not divisible by any of the primes you sieved out. Last fiddled with by CRGreathouse on 2010-08-17 at 17:10 |
|
|
|
|
|
|
#623 | |
|
May 2010
Prime hunting commission.
24·3·5·7 Posts |
Quote:
Last fiddled with by 3.14159 on 2010-08-17 at 17:12 |
|
|
|
|
|
|
#624 | |
|
Aug 2006
3×1,993 Posts |
Quote:
And there's absolutely no reason to store the vector in a file (though Pari could certainly do that). I still don't know what you mean by return values, or why you think printing has anything to do with any of this. Last fiddled with by CRGreathouse on 2010-08-17 at 17:14 |
|
|
|
|
|
|
#625 | |
|
May 2010
Prime hunting commission.
24×3×5×7 Posts |
Quote:
Last fiddled with by 3.14159 on 2010-08-17 at 17:31 |
|
|
|
|
|
|
#626 |
|
Aug 2006
3×1,993 Posts |
|
|
|
|
|
|
#627 | |
|
May 2010
Prime hunting commission.
24×3×5×7 Posts |
Quote:
em2 can't be made a vector. I think there's simply no way to do it using vectors. Last fiddled with by 3.14159 on 2010-08-17 at 18:17 |
|
|
|
|
![]() |
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 |