mersenneforum.org  

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

Reply
 
Thread Tools
Old 2010-12-07, 01:25   #2036
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26×131 Posts
Default

Quote:
Originally Posted by CRGreathouse View Post
It should...

Code:
> v=vector(3,n,n);v[2]+=10;v
%1 = [1, 12, 3]
> v=vectorsmall(3,n,n);v[2]+=10;v
%2 = Vecsmall([1, 12, 3])


Right, it uses C strings rather than Unicode. A person who cared should be able to hack together a solution with enough care, but since I avoid Pari for string processing I haven't though about it much. (I have run into it, though, like when I mention French or German authors in addhelp() lines and can't use accents in their names.)
if I could make a list of all the alt characters you wanted in vecsmall maybe making a function alt(x) might help.
science_man_88 is offline   Reply With Quote
Old 2010-12-07, 01:59   #2037
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

3×1,993 Posts
Default

Quote:
Originally Posted by science_man_88 View Post
if I could make a list of all the alt characters you wanted in vecsmall maybe making a function alt(x) might help.
You can't store anything but ASCII characters in Pari strings (because, underneath, they're just C strings which have the same limitation).
CRGreathouse is offline   Reply With Quote
Old 2010-12-07, 01:59   #2038
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26×131 Posts
Default

nope vecsmall only stores it as integers by the looks of it but I can't get all of them to work.
science_man_88 is offline   Reply With Quote
Old 2010-12-07, 02:01   #2039
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26×131 Posts
Default

Quote:
Originally Posted by CRGreathouse View Post
You can't store anything but ASCII characters in Pari strings (because, underneath, they're just C strings which have the same limitation).
http://evanjones.ca/unicode-in-c.html has how they do it in C wonder if we can implement the same in Pari lol.
science_man_88 is offline   Reply With Quote
Old 2010-12-07, 02:10   #2040
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

3·1,993 Posts
Default

Quote:
Originally Posted by science_man_88 View Post
http://evanjones.ca/unicode-in-c.html has how they do it in C wonder if we can implement the same in Pari lol.
I alluded to this in post #2035. It's quite possible, though it would require perhaps a thousand changes in the Pari source code (mostly small).

Quote:
Originally Posted by science_man_88 View Post
nope vecsmall only stores it as integers by the looks of it but I can't get all of them to work.
Reread my post.
CRGreathouse is offline   Reply With Quote
Old 2010-12-07, 16:00   #2041
kar_bon
 
kar_bon's Avatar
 
Mar 2006
Germany

22·727 Posts
Default

Quote:
Originally Posted by CRGreathouse View Post
Quote:
- The expression "sup[n]=sup[n]+32" won't work with "sup[n]+=32" !
It should...

Code:
> v=vector(3,n,n);v[2]+=10;v
%1 = [1, 12, 3]
> v=vectorsmall(3,n,n);v[2]+=10;v
%2 = Vecsmall([1, 12, 3])
I used that one directly in the Strchr-function:

Code:
s=concat(s,Strchr(sup[n]-=32))
and that will produce the error:

Code:
*** _-=_: bug in PARI/GP (Segmentation Fault), please report
Perhaps something really to report!?

But the code
Code:
s=concat(s,Strchr(sup[n]=sup[n]-32))
works here fine.
kar_bon is offline   Reply With Quote
Old 2010-12-07, 17:51   #2042
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

597910 Posts
Default

Quote:
Originally Posted by kar_bon View Post
I used that one directly in the Strchr-function:

Code:
s=concat(s,Strchr(sup[n]-=32))
and that will produce the error:

Code:
*** _-=_: bug in PARI/GP (Segmentation Fault), please report
Perhaps something really to report!?

But the code
Code:
s=concat(s,Strchr(sup[n]=sup[n]-32))
works here fine.
Interesting. I may report this.

Regardless, you don't need to do that here; you can just do
Code:
StrToUp(str)={
	my(sup=Vecsmall(str),s="");
	for(n=1,#sup,
		if(sup[n]>=97 && sup[n]<=122,
			s=concat(s,Strchr(sup[n]-32))
		,
			s=concat(s,Strchr(sup[n]))
		)
	);
	s
};
since you don't use sup later.
CRGreathouse is offline   Reply With Quote
Old 2010-12-08, 02:38   #2043
3.14159
 
3.14159's Avatar
 
May 2010
Prime hunting commission.

168010 Posts
Default

It's been somewhat difficult to find a factor for sigma(4477204945765526980349352291678647292170001931988428673↑2), or 20045364126387295389488107373344241624560499868937574184788150529738565510740963223091652652278528299596969603.

So far, I've found no factors ≤ 30 digits.

Last fiddled with by 3.14159 on 2010-12-08 at 02:47
3.14159 is offline   Reply With Quote
Old 2010-12-08, 13:20   #2044
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

100000110000002 Posts
Default

anyone want to see the encoding I made to show for 40 questions I don't think it will hurt it too much lol.

Code:
coding(string) = a=Vecsmall(string);for(y=1,#a,vecsort(a);for(x=1,#a,a[x]=a[x]+x));for(z=1,#a,if(z%2==0,print1(Strchr(a[z]%256)),print1(a[z])));print1("\n"string)
science_man_88 is offline   Reply With Quote
Old 2010-12-08, 13:33   #2045
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

100000110000002 Posts
Default

I got this recently lol :

Code:
(21:17)>coding(string) = a=Vecsmall(string);vecsort(a);for(x=1,#a,a[x]+=x)
%32 = (string)->a=Vecsmall(string);vecsort(a);for(x=1,#a,a[x]+=x)
(21:17)>coding("string")
  *** _+=_: bug in PARI/GP (Segmentation Fault), please report
science_man_88 is offline   Reply With Quote
Old 2010-12-08, 13:47   #2046
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

3×1,993 Posts
Default

Quote:
Originally Posted by 3.14159 View Post
It's been somewhat difficult to find a factor for sigma(4477204945765526980349352291678647292170001931988428673↑2), or 20045364126387295389488107373344241624560499868937574184788150529738565510740963223091652652278528299596969603.

So far, I've found no factors ≤ 30 digits.
Nothing to 45 digits (though I'm not quite finished with the ECM). It's almost surely a semiprime, and a hard one at that. You might have to use NFS if you want to crack it.
CRGreathouse is offline   Reply With Quote
Reply



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 22:31.


Fri Aug 6 22:31:28 UTC 2021 up 14 days, 17 hrs, 1 user, load averages: 3.46, 3.33, 3.24

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.