ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sat, 04 Apr 2020 12:58:05 +0200Problem with simple Pari/GP script in Sage Cell Serverhttps://ask.sagemath.org/question/50508/problem-with-simple-parigp-script-in-sage-cell-server/I am trying to run the following Pari/GP script in Sage Cell Server:
for(x=1, 1000000, for(y=1, 1000000, if(floor((sigma(x)/y)+(sigma(y)/x))==2x-sigma(x),print(x," ",y))))
I cannot seem to figure out what is wrong with it.
I confirm that I am choosing the correct option in the drop-down menu (i.e., GP).
I am getting the following error message:
*** expected character: ',' or ')' instead of: ...ma(x)/y)+(sigma(y)/x))==2
*** x-sigma(x),print(x," Sat, 04 Apr 2020 12:56:40 +0200https://ask.sagemath.org/question/50508/problem-with-simple-parigp-script-in-sage-cell-server/Answer by Jose Arnaldo Bebita-Dris for <p>I am trying to run the following Pari/GP script in Sage Cell Server:</p>
<pre><code>for(x=1, 1000000, for(y=1, 1000000, if(floor((sigma(x)/y)+(sigma(y)/x))==2x-sigma(x),print(x," ",y))))
</code></pre>
<p>I cannot seem to figure out what is wrong with it.</p>
<p>I confirm that I am choosing the correct option in the drop-down menu (i.e., GP).</p>
<p>I am getting the following error message:</p>
<pre><code>*** expected character: ',' or ')' instead of: ...ma(x)/y)+(sigma(y)/x))==2
*** x-sigma(x),print(x,"
</code></pre>
https://ask.sagemath.org/question/50508/problem-with-simple-parigp-script-in-sage-cell-server/?answer=50509#post-id-50509Blimey! I figured it out.
Pari/GP script should have been:
for(x=1, 1000000, for(y=1, 1000000, if(floor((sigma(x)/y)+(sigma(y)/x))==2*x-sigma(x),print(x," ",y))))
(the original had `2x` instead of `2*x`).Sat, 04 Apr 2020 12:58:05 +0200https://ask.sagemath.org/question/50508/problem-with-simple-parigp-script-in-sage-cell-server/?answer=50509#post-id-50509