mersenneforum.org  

Go Back   mersenneforum.org > Math Stuff > Computer Science & Computational Number Theory > PARI/GP

Reply
 
Thread Tools
Old 2010-08-19, 23:45   #727
kar_bon
 
kar_bon's Avatar
 
Mar 2006
Germany

22·727 Posts
Default

Quote:
Originally Posted by 3.14159 View Post
You said I made several contradictory names for various prime forms, and you were therefore accusing me of being internally inconsistent. Please show where I am internally inconsistent.
So read again:

Quote:
Originally Posted by CRGreathouse View Post
I can never keep track of all the names (especially since some are contradictory... e.g. several definitions for generalized Fermats). What form are these?
He never accused you! It was meant generally!
kar_bon is offline   Reply With Quote
Old 2010-08-20, 01:09   #728
3.14159
 
3.14159's Avatar
 
May 2010
Prime hunting commission.

69016 Posts
Default

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
3.14159 is offline   Reply With Quote
Old 2010-08-20, 01:14   #729
3.14159
 
3.14159's Avatar
 
May 2010
Prime hunting commission.

24×3×5×7 Posts
Default

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
3.14159 is offline   Reply With Quote
Old 2010-08-20, 01:25   #730
3.14159
 
3.14159's Avatar
 
May 2010
Prime hunting commission.

24×3×5×7 Posts
Default

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.
3.14159 is offline   Reply With Quote
Old 2010-08-20, 12:24   #731
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26×131 Posts
Default

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
science_man_88 is offline   Reply With Quote
Old 2010-08-20, 12:44   #732
3.14159
 
3.14159's Avatar
 
May 2010
Prime hunting commission.

69016 Posts
Default

Quote:
Originally Posted by science_man_88
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.
Damn. I forgot to change that to "lim".
3.14159 is offline   Reply With Quote
Old 2010-08-20, 12:48   #733
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26·131 Posts
Default

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.
science_man_88 is offline   Reply With Quote
Old 2010-08-20, 13:02   #734
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

20C016 Posts
Default

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
science_man_88 is offline   Reply With Quote
Old 2010-08-20, 15:00   #735
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

203008 Posts
Default

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)))
is my newest attempt at what I wanted to help CRG with. unfortunately this gives me errors.
science_man_88 is offline   Reply With Quote
Old 2010-08-20, 18:29   #736
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26·131 Posts
Default

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
science_man_88 is offline   Reply With Quote
Old 2010-08-20, 18:47   #737
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

203008 Posts
Default

I have other ideas about how to but I don't know enough on the routines.
I was also thinking vecextract.
science_man_88 is offline   Reply With Quote
Reply

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

All times are UTC. The time now is 23:07.


Fri Aug 6 23:07:26 UTC 2021 up 14 days, 17:36, 1 user, load averages: 3.82, 3.85, 3.90

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.