mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   PARI/GP (https://www.mersenneforum.org/forumdisplay.php?f=155)
-   -   PARI's commands (https://www.mersenneforum.org/showthread.php?t=13636)

science_man_88 2010-12-07 01:25

[QUOTE=CRGreathouse;240426]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])[/CODE]



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.)[/QUOTE]

if I could make a list of all the alt characters you wanted in vecsmall maybe making a function alt(x) might help.

CRGreathouse 2010-12-07 01:59

[QUOTE=science_man_88;240428]if I could make a list of all the alt characters you wanted in vecsmall maybe making a function alt(x) might help.[/QUOTE]

You can't store anything but ASCII characters in Pari strings (because, underneath, they're just C strings which have the same limitation).

science_man_88 2010-12-07 01:59

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 2010-12-07 02:01

[QUOTE=CRGreathouse;240430]You can't store anything but ASCII characters in Pari strings (because, underneath, they're just C strings which have the same limitation).[/QUOTE]

[url]http://evanjones.ca/unicode-in-c.html[/url] has how they do it in C wonder if we can implement the same in Pari lol.

CRGreathouse 2010-12-07 02:10

[QUOTE=science_man_88;240432][url]http://evanjones.ca/unicode-in-c.html[/url] has how they do it in C wonder if we can implement the same in Pari lol.[/QUOTE]

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=science_man_88;240431]nope vecsmall only stores it as integers by the looks of it but I can't get all of them to work.[/QUOTE]

Reread my post.

kar_bon 2010-12-07 16:00

[QUOTE=CRGreathouse;240426]
[quote]
- The expression "sup[n]=sup[n]+32" won't work with "sup[n]+=32" !
[/quote]
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])[/CODE]

[/QUOTE]

I used that one directly in the Strchr-function:

[code]
s=concat(s,Strchr(sup[n]-=32))
[/code]

and that will produce the error:

[code]
*** _-=_: bug in PARI/GP (Segmentation Fault), please report
[/code]

Perhaps something really to report!?

But the code
[code]
s=concat(s,Strchr(sup[n]=sup[n]-32))
[/code]
works here fine.

CRGreathouse 2010-12-07 17:51

[QUOTE=kar_bon;240520]I used that one directly in the Strchr-function:

[code]
s=concat(s,Strchr(sup[n]-=32))
[/code]

and that will produce the error:

[code]
*** _-=_: bug in PARI/GP (Segmentation Fault), please report
[/code]

Perhaps something really to report!?

But the code
[code]
s=concat(s,Strchr(sup[n]=sup[n]-32))
[/code]
works here fine.[/QUOTE]

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
};[/CODE]
since you don't use sup later.

3.14159 2010-12-08 02:38

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

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

science_man_88 2010-12-08 13:20

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)[/CODE]

science_man_88 2010-12-08 13:33

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")
[COLOR="Red"]*** _+=_: bug in PARI/GP (Segmentation Fault), please report[/COLOR][/CODE]

CRGreathouse 2010-12-08 13:47

[QUOTE=3.14159;240629]It's been somewhat difficult to find a factor for sigma(4477204945765526980349352291678647292170001931988428673↑2), or 20045364126387295389488107373344241624560499868937574184788150529738565510740963223091652652278528299596969603.

So far, I've found no factors ≤ 30 digits.[/QUOTE]

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.


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

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