![]() |
|
|
#551 | |
|
May 2010
Prime hunting commission.
24·3·5·7 Posts |
Quote:
Also: It would be a difficult task to write a sieve for k * n! + 1 in PARI/GP Last fiddled with by 3.14159 on 2010-08-16 at 01:12 |
|
|
|
|
|
|
#552 |
|
May 2010
Prime hunting commission.
24×3×5×7 Posts |
You suggested the use of lift(Mod(-1,x)/(n!)) and lift(Mod(1,x)/(n!))
Last fiddled with by 3.14159 on 2010-08-16 at 01:14 |
|
|
|
|
|
#553 |
|
Aug 2006
3·1,993 Posts |
I think I was pretty clear, but if it didn't come across that way I suppose that speaks to my communications skills.
Somehow I really just don't enjoy writing sieves. I just wrote one today (on a project with Vladimir Shevelev) and I've been working on a specialized siever for one of my sequences in the OEIS. The quick ones (yours and the one I made for Vladimir) aren't too bad, but this other one has been just draining... it's a pain, since this one needs to be really efficient (since it will run over the course of several months). |
|
|
|
|
|
#554 |
|
Aug 2006
597910 Posts |
Yes, I think that's the right calculation. Check it with an example before trusting me, though... I've already messed up one siever today.
Ugh, lost 6 hours of work with that one.For my earlier sieve the calculations were essentially Code:
b=znorder(Mod(2,p)); a=znlog(2293,Mod(2,p),b); Last fiddled with by CRGreathouse on 2010-08-16 at 01:16 |
|
|
|
|
|
#555 | ||
|
May 2010
Prime hunting commission.
24·3·5·7 Posts |
Quote:
Quote:
Mod(-1,p)/(n!) gives the smallest k for which (k * n! + 1)%p=0, and Mod(1,p)/(n!) gives the smallest k for which (k * n! -1)%p=0. I'm searching for k * n! + 1. Mod(-1,p)/(n!) will help me a bit more here. Last fiddled with by 3.14159 on 2010-08-16 at 12:12 |
||
|
|
|
|
|
#556 |
|
Aug 2006
135338 Posts |
http://oeis.org/classic/A176494 -- see the seqfan archives if you're interested.
Right. So start at the place where k * n! + 1 is 0, and repeatedly add on the k-value where k * n! = 1 mod p. Yes? |
|
|
|
|
|
#557 | |
|
May 2010
Prime hunting commission.
24·3·5·7 Posts |
Since the point of a sieve is to avoid trial division: (forstep) loops.
At this point, I can get rid of specific divisors, but not groups of them. Quote:
>Mod(-1, 229)/(22!) %1 = Mod(105, 229) 105 * 22! + 1 = 0 mod 229. In other words, 105 * 22! + 1 is divisible by 229. >Mod(1, 229)/(22!) %1 = Mod(124, 229) So the forstep= (n=105,a,124,..) ? Last fiddled with by 3.14159 on 2010-08-16 at 12:43 |
|
|
|
|
|
|
#558 |
|
May 2010
Prime hunting commission.
24·3·5·7 Posts |
If so, that is incorrect, because it would also kick out prime numbers. (Ex: 9405 * 22! + 1 is prime.)
Last fiddled with by 3.14159 on 2010-08-16 at 12:50 |
|
|
|
|
|
#559 |
|
Aug 2006
3·1,993 Posts |
Maybe the step size just needs to be the prime itself?
|
|
|
|
|
|
#560 | |
|
May 2010
Prime hunting commission.
24×3×5×7 Posts |
Quote:
(Verified, every k value after 105 that was of the form 105 + 229a yielded a k * 22! + 1 value that was divisible by 229.) Last fiddled with by 3.14159 on 2010-08-16 at 12:55 |
|
|
|
|
|
|
#561 |
|
May 2010
Prime hunting commission.
24×3×5×7 Posts |
So, the forstep is set.
forstep(n=105,a,229,if((n*22!+1)%229==0,print(n))) But that only gets rid of one divisor, 229. What if we wished to get rid of 229 and 233? One suggestion I received was to write two or more separate commands within one script: One for each divisor. A forstep command for 229, and a separate forstep command for 233, within the same script. Excellent. Last fiddled with by 3.14159 on 2010-08-16 at 13:00 |
|
|
|
![]() |
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 |