mersenneforum.org  

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

Reply
 
Thread Tools
Old 2012-03-05, 03:24   #2344
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

3·1,993 Posts
Default

Quote:
Originally Posted by science_man_88 View Post
I got back that partitions is not a function.
That was added in version 2.4.3, released two years ago. Upgrade your version of gp and get all the latest stuff.
CRGreathouse is offline   Reply With Quote
Old 2012-03-05, 13:03   #2345
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

20C016 Posts
Default

Quote:
Originally Posted by CRGreathouse View Post
That was added in version 2.4.3, released two years ago. Upgrade your version of gp and get all the latest stuff.
http://pari.math.u-bordeaux.fr/download.html 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.

Last fiddled with by science_man_88 on 2012-03-05 at 13:09
science_man_88 is offline   Reply With Quote
Old 2012-03-05, 15:52   #2346
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26·131 Posts
Default

Quote:
Originally Posted by science_man_88 View Post
http://pari.math.u-bordeaux.fr/download.html 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.
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
is as far as I have what I think is correct for use with aliquot sequences going backwards.

Last fiddled with by science_man_88 on 2012-03-05 at 15:59
science_man_88 is offline   Reply With Quote
Old 2012-03-07, 11:49   #2347
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

3×1,993 Posts
Cool

Now remember to use my() for all variables you use in your functions...
CRGreathouse is offline   Reply With Quote
Old 2012-03-10, 14:23   #2348
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

203008 Posts
Default

Quote:
Originally Posted by science_man_88 View Post
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
is as far as I have what I think is correct for use with aliquot sequences going backwards.
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.

Last fiddled with by science_man_88 on 2012-03-10 at 14:36
science_man_88 is offline   Reply With Quote
Old 2012-05-14, 22:38   #2349
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

203008 Posts
Default

Quote:
Originally Posted by science_man_88 View Post
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.
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.

Last fiddled with by science_man_88 on 2012-05-14 at 23:04
science_man_88 is offline   Reply With Quote
Old 2012-05-14, 23:46   #2350
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

203008 Posts
Default

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:
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))
still doesn't work well with large amounts of partitions ( stupid memory limits).

Last fiddled with by science_man_88 on 2012-05-14 at 23:57
science_man_88 is offline   Reply With Quote
Old 2012-07-10, 18:29   #2351
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26·131 Posts
Default

Quote:
Originally Posted by science_man_88 View Post
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))
made this after reading in the HP(49) thread. which gave me links to learn about home primes.
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 is offline   Reply With Quote
Old 2012-07-10, 18:47   #2352
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26·131 Posts
Default

Quote:
Originally Posted by science_man_88 View Post
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.
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)

Last fiddled with by science_man_88 on 2012-07-10 at 18:53
science_man_88 is offline   Reply With Quote
Old 2012-07-10, 19:36   #2353
Batalov
 
Batalov's Avatar
 
"Serge"
Mar 2008
Phi(4,2^7658614+1)/2

9,497 Posts
Default

science_man_88: it is not a very good idea to publicly engage in meaningful conversations with yourself. At the very least, you really, really don't have to quote in full your own message?! Another board bluntly classifies such postings as post whoring. (They don't mince words, do they now?)
Batalov is offline   Reply With Quote
Old 2012-07-10, 19:43   #2354
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26·131 Posts
Default

Quote:
Originally Posted by Batalov View Post
science_man_88: it is not a very good idea to publicly engage in meaningful conversations with yourself.
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.
science_man_88 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 15:31.


Fri Aug 6 15:31:39 UTC 2021 up 14 days, 10 hrs, 1 user, load averages: 2.36, 2.72, 2.83

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.