![]() |
|
|
#562 |
|
Aug 2006
135338 Posts |
|
|
|
|
|
|
#563 | |
|
May 2010
Prime hunting commission.
24×3×5×7 Posts |
Quote:
Last fiddled with by 3.14159 on 2010-08-16 at 14:11 |
|
|
|
|
|
|
#564 |
|
Aug 2006
3×1,993 Posts |
I have to drag you kicking and screaming, don't I.
So inside the loop you know that exponent n is bad (creates a number divisible by p). So you need to have a list of numbers and mark number n as bad (whatever value you choose for that). |
|
|
|
|
|
#565 | |
|
May 2010
Prime hunting commission.
24×3×5×7 Posts |
Quote:
If a certain k * n! + 1 is divisible by, let's say, 2550871, I would make a forstep loop, where the step size = 2550871, where all the k-values that would be divisible by 2550871 are eliminated. If n = 430, and k goes up to 108: Eliminated k's are: Code:
702669 3253540 5804411 8355282 10906153 13457024 16007895 18558766 21109637 23660508 26211379 28762250 31313121 33863992 36414863 38965734 41516605 44067476 46618347 49169218 51720089 54270960 56821831 59372702 61923573 64474444 67025315 69576186 72127057 74677928 77228799 79779670 82330541 84881412 87432283 89983154 92534025 95084896 97635767 Or: A smaller prime: 577. There would be 173310 k-values eliminated by 577. Last fiddled with by 3.14159 on 2010-08-16 at 14:30 |
|
|
|
|
|
|
#566 |
|
May 2010
Prime hunting commission.
24×3×5×7 Posts |
I thought of a code snippet:
Note: e = variable, not 2.718281828459045.. kfacsieve(a,x,e,b) = { forprime(p=a,x, forstep(n=lift(Mod(-1,p)/(e!),10^b,p,print(n)) ); } (Please check for any errors I might have made there.) Last fiddled with by 3.14159 on 2010-08-16 at 14:58 Reason: Error in code. |
|
|
|
|
|
#567 |
|
Aug 2006
3×1,993 Posts |
OK. Now show what's left, not what's removed. You'll generally want to sieve out all the primes in a large range (at the very least 3 to 1e6).
Last fiddled with by CRGreathouse on 2010-08-16 at 14:55 |
|
|
|
|
|
#568 | |
|
May 2010
Prime hunting commission.
24·3·5·7 Posts |
Quote:
Last fiddled with by 3.14159 on 2010-08-16 at 14:59 |
|
|
|
|
|
|
#569 |
|
Aug 2006
3×1,993 Posts |
|
|
|
|
|
|
#570 | |
|
May 2010
Prime hunting commission.
24·3·5·7 Posts |
Quote:
|
|
|
|
|
|
|
#571 |
|
Aug 2006
3·1,993 Posts |
Ah, so I must have been lying about having constructed a sieve in Pari earlier, and I must be intentionally misleading you now.
|
|
|
|
|
|
#572 | |
|
May 2010
Prime hunting commission.
24×3×5×7 Posts |
Quote:
|
|
|
|
|
![]() |
| 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 |