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)

CRGreathouse 2012-03-05 03:24

[QUOTE=science_man_88;291861]I got back that partitions is not a function.[/QUOTE]

That was added in version 2.4.3, released two years ago. Upgrade your version of gp and get all the latest stuff.

science_man_88 2012-03-05 13:03

[QUOTE=CRGreathouse;291926]That was added in version 2.4.3, released two years ago. Upgrade your version of gp and get all the latest stuff.[/QUOTE]

[url]http://pari.math.u-bordeaux.fr/download.html[/url] latest posted for a self installing one is 2.4.2

I have a download of 2.5.1.exe it is there but the download info says very basic.

science_man_88 2012-03-05 15:52

[QUOTE=science_man_88;291968][url]http://pari.math.u-bordeaux.fr/download.html[/url] latest posted for a self installing one is 2.4.2

I have a download of 2.5.1.exe it is there but the download info says very basic.[/QUOTE]

[CODE]partNo1(n)= a=Vec(select(v->vecmin(v)>1,partitions(n)));for(x=1,#a,if(#vecsort(a[x],,8)!=#a[x],a[x]=0;a[x]=Vec(a[x])));forstep(y=#a,1,-1,if(a[y]==[0],a=vector(y-1,n,a[n])));a[/CODE]

is as far as I have what I think is correct for use with aliquot sequences going backwards.

CRGreathouse 2012-03-07 11:49

Now remember to use my() for all variables you use in your functions...

science_man_88 2012-03-10 14:23

[QUOTE=science_man_88;291983][CODE]partNo1(n)= a=Vec(select(v->vecmin(v)>1,partitions(n)));for(x=1,#a,if(#vecsort(a[x],,8)!=#a[x],a[x]=0;a[x]=Vec(a[x])));forstep(y=#a,1,-1,if(a[y]==[0],a=vector(y-1,n,a[n])));a[/CODE]

is as far as I have what I think is correct for use with aliquot sequences going backwards.[/QUOTE]

hmmm this for some reason deletes some that could be used like 2,4,8 for 14 (15-1) to show that 16 comes from 15 going back. admittedly that runs me into more problems like how to deal with the fact that 1+2+4+8 = 15 but 2*4*8!=16. apparently I have a ways to go. found the part that deleted 2,4,8 by the looks of it it's the last part.

science_man_88 2012-05-14 22:38

[QUOTE=science_man_88;292508]hmmm this for some reason deletes some that could be used like 2,4,8 for 14 (15-1) to show that 16 comes from 15 going back. admittedly that runs me into more problems like how to deal with the fact that 1+2+4+8 = 15 but 2*4*8!=16. apparently I have a ways to go. found the part that deleted 2,4,8 by the looks of it it's the last part.[/QUOTE]

doh I just realized why, 3 and 11 are prime they'd be the only proper divisors of the number but 4 and 8 in the 2,4,8 aren't so there needs to be more numbers added to find the individual values multiplied together 2*8=16 adding 16 to this list 64 would get on the list because it's only using one number, adding 1 to all this leads to a list of proper divisors, doubt it's fast to back check though, so I only need the ones without repeats I've already done that once, then I would need only the first and last elements without adding 1 to it all I believe that should be easy enough.

science_man_88 2012-05-14 23:46

okay I think I have this worked out:

[CODE]ali(f)=g=vector(#partNo1(f-1)-1,k,partNo1(f-1)[k+1]);g[/CODE]

[CODE]partNo1(n)=
a=Vec(select(v->vecmin(v)>1,partitions(n)));
b=[];
for(x=1,#a,
a[x]=if(#vecsort(a[x],,8)!=#a[x],
[0],
Vecsmall(Vec(a[x])));
b=concat(b,
if((a[x][1]*a[x][#a[x]])!=0 && sigma(a[x][1]*a[x][#a[x]])-(a[x][1]*a[x][#a[x]])==(n+1),
a[x][1]*a[x][#a[x]])
)
);
return(vecsort(b,,8))[/CODE]

still doesn't work well with large amounts of partitions ( stupid memory limits).

science_man_88 2012-07-10 18:29

[QUOTE=science_man_88;291301][CODE]homeprime(n)= s=n;until(isprime(s),a=factor(s);b="";for(x=1,#a[,2],until(a[x,2]==0,b=concat(b,Str(a[x,1]));a[x,2]=a[x,2]-1));print(b);s=eval(b))[/CODE]

made this after reading in the HP(49) thread. which gave me links to learn about home primes.[/QUOTE]

I've played with going backwards and the Inverse home prime sequences. going with the inverse you just change to a forstep to concat in the other direction. the backwards home prime gets a little complicated but a few things we can use: home primes concat from lowest to highest so looking at the resulting string/ number working through it from the front end we can check every new prime found against the last to see if it's greater than or equal to it because they need to be at least as big to be in proper order. while reading it from the far end the same is true for IHP.

science_man_88 2012-07-10 18:47

[QUOTE=science_man_88;304410]I've played with going backwards and the Inverse home prime sequences. going with the inverse you just change to a forstep to concat in the other direction. the backwards home prime gets a little complicated but a few things we can use: home primes concat from lowest to highest so looking at the resulting string/ number working through it from the front end we can check every new prime found against the last to see if it's greater than or equal to it because they need to be at least as big to be in proper order. while reading it from the far end the same is true for IHP.[/QUOTE]

I talked in PM about this idea to someone and got told to try it on: 189170531644901822763687

manually ( okay typing into pari) I found 18917 was prime then you realized what number starts with 0 normally none so it can't be that the next time it has a end of 1,3,7,or 9 is 18197053 and that works to be prime next thing to realize is that the original numbers next possible prime is supposed to be larger so it too must have at lest 8 digits 16449018 is 8 but doesn't work as it's even next one that it could be is 16449018227 but this leaves less than the length of this new one left so the next one couldn't be bigger a quick check shows that using the rest is prime so we have our 2 primes in this case 18197053 * 1644901822763687 = 31116694961017273454411 ( pari gives a different answer now and this is the answer in the factorDB)

Batalov 2012-07-10 19:36

[B]science_man_88: [/B]it is not a very good idea to publicly engage in meaningful conversations [I]with yourself[/I]. At the very least, you [I]really, really[/I] don't have to quote in full [I]your own message[/I]?! [URL="http://seqanswers.com/forums/faq.php"]Another board[/URL] bluntly classifies such postings as post whoring. (They don't mince words, do they now?)

science_man_88 2012-07-10 19:43

[QUOTE=Batalov;304415][B]science_man_88: [/B]it is not a very good idea to publicly engage in meaningful conversations [I]with yourself[/I]. [/QUOTE]

the fact that anything I say is considered meaningful is somewhat of a surprise especially since it's coming from someone who's not just a basic member.


All times are UTC. The time now is 22:48.

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