![]() |
|
|
#727 | |
|
Mar 2006
Germany
1011010111002 Posts |
Quote:
He never accused you! It was meant generally! |
|
|
|
|
|
|
#728 |
|
May 2010
Prime hunting commission.
24×3×5×7 Posts |
Alright: My sieve only requires three arguments, as it is just Generalized proths. (Two for the kmin/kmax, one for the base and exponent)
Now it should be far easier to make all the appropriate substitutions and so on. @CRG/sm88: Any hints on the appropriate substitutions, as the amount of arguments are the same? Here is the original code: Code:
sieve(lim, sz, sm=1)={
my(v=vectorsmall(sz,i,1));
forprime(p=3,p2,
b=znorder(Mod(2,p));
trap(,next,
a=znlog(2293,Mod(2,p))
);
if(Mod(2,p)^a!=2293, print("bad at "p);next);
a+=b*ceil((sm-a)/b);
forstep(n=a,sz,b,
v[n]=0
)
);
a=0;
for(i=sm,sz,if(v[i],a++;write("abc.txt", i)));
a
};
Last fiddled with by 3.14159 on 2010-08-20 at 01:15 |
|
|
|
|
|
#729 |
|
May 2010
Prime hunting commission.
24·3·5·7 Posts |
Make as many substitutions and modifications as you'd like. I'll try to make the appropriate substitutions/modifications to see if I can reach a finished product.
Last fiddled with by 3.14159 on 2010-08-20 at 01:21 |
|
|
|
|
|
#730 |
|
May 2010
Prime hunting commission.
168010 Posts |
I thought of substituting the variables with the variables I designated, but this essentially does the same, and prints out the same factors, except it does so up to 106.
Now it seems that substitutions didn't cut it. Any recommended modifications, anyone? Last fiddled with by 3.14159 on 2010-08-20 at 01:28 Reason: Errors everywhere. You disgust me. |
|
|
|
|
|
#731 |
|
"Forget I exist"
Jul 2009
Dumbassville
26·131 Posts |
one thing i find is you have a variable p2 declared as a maximum but no definition of it before hand that I know of.
Last fiddled with by science_man_88 on 2010-08-20 at 12:29 |
|
|
|
|
|
#732 | |
|
May 2010
Prime hunting commission.
24×3×5×7 Posts |
Quote:
|
|
|
|
|
|
|
#733 |
|
"Forget I exist"
Jul 2009
Dumbassville
20C016 Posts |
since you use znlog() you can just check if a is a factorial because g^n=x n gets stored in a so if a=c! then the exponent to check is c! not a! so checking if a is a factorial means if true a!=c!! or a double factorial if such a thing exist anyway I'll shut up.
|
|
|
|
|
|
#734 |
|
"Forget I exist"
Jul 2009
Dumbassville
203008 Posts |
you write i but unless you have a seperator you won't be able to figure out what's what in abc.txt I know I couldn't so adding "," to that call might be warranted if you want it to be understood.
Last fiddled with by science_man_88 on 2010-08-20 at 13:15 |
|
|
|
|
|
#735 |
|
"Forget I exist"
Jul 2009
Dumbassville
100000110000002 Posts |
Code:
a=0;y=Vec(input());for(x=1,3,for(i=1,#y,for(p=2,#try[x]-1,if(y[i+(p-1)]==try[x][p],a=a+1;print("really")));if(a==#try[x]-2)))
|
|
|
|
|
|
#736 |
|
"Forget I exist"
Jul 2009
Dumbassville
26·131 Posts |
can setsearch be used on strings if it could we can use that as find and possibly replace if we can find a way to make sure the replacement can fit into it.
got it without errors but not working. Last fiddled with by science_man_88 on 2010-08-20 at 18:36 |
|
|
|
|
|
#737 |
|
"Forget I exist"
Jul 2009
Dumbassville
26×131 Posts |
I have other ideas about how to but I don't know enough on the routines.
I was also thinking vecextract. |
|
|
|
![]() |
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 |