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 2010-09-12 15:01

[QUOTE=science_man_88;229463]return aliquot sequence n[/QUOTE]

Give me an example.

science_man_88 2010-09-12 15:06

[8,7,1] ?

kar_bon 2010-09-12 16:36

[QUOTE=CRGreathouse;229465]Give me an example.[/QUOTE]

[url=http://en.wikipedia.org/wiki/Aliquot_sequence]Aliquot Sequence[/url]:

[tex]\sigma[/tex](N) -> Sum of proper divisors of N (Sigma(N)).

Example sequence:
s[sub]0[/sub]= N
s[sub]1[/sub] = [tex]\sigma[/tex][sub]n-1[/sub] - s[sub]n-1[/sub]

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 [url=http://www.mersenneforum.org/forumdisplay.php?f=90]here[/url] and the first open sequence (without ending found yet) [url=http://factordb.com/search.php?se=1&aq=276&action=last20&fr=&to=]here[/url]
and my summary pages (Menu Aliquot Seqs.) [url=www.rieselprime.de]here[/url] (not yet fully updated).

CRGreathouse 2010-09-12 16:47

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...!

science_man_88 2010-09-12 16:48

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 2010-09-12 16:52

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

looks like something else gone wrong now.

CRGreathouse 2010-09-12 17:17

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.

science_man_88 2010-09-12 17:23

[QUOTE=CRGreathouse;229477]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.[/QUOTE]

put the next one in the sequence etc.

science_man_88 2010-09-12 18:00

got it working now but I get a error of:

[CODE]*** sigma: couldn't find a suitable name for a tempdir (MPQS).[/CODE]

the codes are:

[CODE]Alistep(n)=sigma(n)-n[/CODE]

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

And I tried :

[CODE]for(n=2,1000,Aliquot(n))[/CODE]

science_man_88 2010-09-12 19:23

I'm an idiot the error I was getting was because 276 never ends i think lol or at least in my memory.

CRGreathouse 2010-09-13 00:10

[QUOTE=science_man_88;229491]I'm an idiot the error I was getting was because 276 never ends i think lol or at least in my memory.[/QUOTE]

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)


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

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