![]() |
|
|
#628 |
|
Aug 2006
3×1,993 Posts |
Your statements are , likewise, unclear to me. (Why are you trying to make em2 a vector?!?) But I know that it can be done since I do this all the time.
|
|
|
|
|
|
#629 |
|
May 2010
Prime hunting commission.
24×3×5×7 Posts |
Vectors are inefficient and unnecessary here. em2 and mem were decent advances. em2 and mem were, as I see it, the most progress I ever made.
Last fiddled with by 3.14159 on 2010-08-17 at 18:20 |
|
|
|
|
|
#630 | |
|
May 2010
Prime hunting commission.
24·3·5·7 Posts |
Quote:
mem needs some fixing in order to avoid the loop repeat: em2 is 100% functional. Last fiddled with by 3.14159 on 2010-08-17 at 18:22 |
|
|
|
|
|
|
#631 |
|
Aug 2006
3×1,993 Posts |
Well, post your functions and maybe we can compare.
|
|
|
|
|
|
#632 |
|
Mar 2006
Germany
22×727 Posts |
Not so hard to understand:
You searching for say k*360! + 1, so set v[1]=1 (k=1) v[2]=2 (k=2) v[3]=3 (k=3) ... v[n]=n (k=n) for all k-values you want to search for. If you find a primefactor of say 123*360!+1, set v[123]=0. Do this for all primefactors you will test: set the vector[index]=0. After you've sieved all primefactors, the vector v contains some/many values set to 0, so these indices have a small factor and you do not need to test them. You can "print" all indices n, where v[n] != 0, -> no primefactor found after sieving -> list of all k-values to test! |
|
|
|
|
|
#633 |
|
Aug 2006
3·1,993 Posts |
Yes. Though I would set them all to 1 rather than to their own values -- you know that from their location. Of course ideally you'd use just one bit per number rather than a whole word, but for convenience in Pari I usually don't bother.
|
|
|
|
|
|
#634 | |
|
Mar 2006
Germany
B5C16 Posts |
Quote:
And further: There's no need to divide every candidate by that small factor: Find the first occurence and the step-width (like in the example from yesterday) and it's a simple for-loop to strike out all candidates with that small factor! |
|
|
|
|
|
|
#635 | ||
|
May 2010
Prime hunting commission.
24×3×5×7 Posts |
Quote:
Quote:
Last fiddled with by 3.14159 on 2010-08-17 at 18:52 |
||
|
|
|
|
|
#636 | |
|
May 2010
Prime hunting commission.
24·3·5·7 Posts |
Quote:
Interesting coincidence: 353, 360, and 367 are all 7 units apart. 353 * 360! + 1 is divisible by 367. Last fiddled with by 3.14159 on 2010-08-17 at 18:56 |
|
|
|
|
|
|
#637 |
|
Aug 2006
3·1,993 Posts |
Yeah, I told you half a dozen times how to handle that, including a commentary of the effectiveness of different versions.
Code:
v=vector(number_of_k_values_to_test) Last fiddled with by CRGreathouse on 2010-08-17 at 19:08 |
|
|
|
|
|
#638 | ||
|
May 2010
Prime hunting commission.
24·3·5·7 Posts |
Quote:
If you're referring to em2: em2(x,n,a)=forstep(b=lift(Mod(-1,x)/n),10^a,x, print(b)) Quote:
Last fiddled with by 3.14159 on 2010-08-17 at 19:14 |
||
|
|
|
![]() |
| Thread Tools | |
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 |