mersenneforum.org  

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

Reply
 
Thread Tools
Old 2010-09-12, 15:01   #1409
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

597910 Posts
Default

Quote:
Originally Posted by science_man_88 View Post
return aliquot sequence n
Give me an example.
CRGreathouse is offline   Reply With Quote
Old 2010-09-12, 15:06   #1410
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26×131 Posts
Default

[8,7,1] ?

Last fiddled with by science_man_88 on 2010-09-12 at 15:20 Reason: think I got the sequence wrong
science_man_88 is offline   Reply With Quote
Old 2010-09-12, 16:36   #1411
kar_bon
 
kar_bon's Avatar
 
Mar 2006
Germany

22·727 Posts
Default

Quote:
Originally Posted by CRGreathouse View Post
Give me an example.
Aliquot Sequence:

\sigma(N) -> Sum of proper divisors of N (Sigma(N)).

Example sequence:
s0= N
s1 = \sigman-1 - sn-1

So for N=10 you get:
10 = 10+ 5 + 2 + 1 = 18 -> 18-10 = 8
8 = 8 + 4 + 2 + 1 = 15 -> 15-8 = 7
7 = 7 + 1 = 8 -> 8-7 = 1 STOP

Ses also the thread here and the first open sequence (without ending found yet) here
and my summary pages (Menu Aliquot Seqs.) here (not yet fully updated).
kar_bon is offline   Reply With Quote
Old 2010-09-12, 16:47   #1412
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

3×1,993 Posts
Default

kar_bon, I understand what an aliquot sequence is, but that doesn't tell me what sm88 wants.

I take it from his last post that he wants a vector with last term 1 and first term the input, where v[i+1] = sigma(v[i]) - v[i]. But of course it's not even proven that such a vector exists for all n...!
CRGreathouse is offline   Reply With Quote
Old 2010-09-12, 16:48   #1413
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

203008 Posts
Default

basically I wanted to try and find all of the aliquot sequences but I made code that no matter what and I may have an earlier code than this but no matter what I get an error for all but perfect numbers.
science_man_88 is offline   Reply With Quote
Old 2010-09-12, 16:52   #1414
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26×131 Posts
Default

Code:
%68 = (n)->v=vector(1,x,n);for(a=2,10,d=sumdiv(v[a-1],X,X=X)-v[a=1];v=concat(v,d))
(13:51) gp > Aliquot(4)
  ***   user interrupt after 27,032 ms.
  ***   bug in PARI/GP (Segmentation Fault), please report
looks like something else gone wrong now.
science_man_88 is offline   Reply With Quote
Old 2010-09-12, 17:17   #1415
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

135338 Posts
Default

It may be worth pointing out that the aliquot function is calculated in Pari as
sigma(n)-n
and so essentially all of your program will be doing 'the rest', whatever that is.
CRGreathouse is offline   Reply With Quote
Old 2010-09-12, 17:23   #1416
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 may be worth pointing out that the aliquot function is calculated in Pari as
sigma(n)-n
and so essentially all of your program will be doing 'the rest', whatever that is.
put the next one in the sequence etc.
science_man_88 is offline   Reply With Quote
Old 2010-09-12, 18:00   #1417
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26×131 Posts
Default

got it working now but I get a error of:

Code:
*** sigma: couldn't find a suitable name for a tempdir (MPQS).
the codes are:

Code:
Alistep(n)=sigma(n)-n
And :

Code:
Aliquot(n)= v=vector(1,x,n);for(a=2,1000,d=Alistep(v[a-1]);v=concat(v,d);if(d==n || d==1,break()));print(v)
And I tried :

Code:
for(n=2,1000,Aliquot(n))
science_man_88 is offline   Reply With Quote
Old 2010-09-12, 19:23   #1418
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26×131 Posts
Default

I'm an idiot the error I was getting was because 276 never ends i think lol or at least in my memory.
science_man_88 is offline   Reply With Quote
Old 2010-09-13, 00:10   #1419
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

3×1,993 Posts
Default

Quote:
Originally Posted by science_man_88 View Post
I'm an idiot the error I was getting was because 276 never ends i think lol or at least in my memory.
You could have it print at every step to see what's going on. Also, you could durn up the debug setting and watch the details of the factorization:
default(debug,4)
CRGreathouse 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:11.


Fri Aug 6 23:11:56 UTC 2021 up 14 days, 17:40, 1 user, load averages: 4.26, 4.21, 4.04

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.