Ask Your Question
1

I cannot seem to figure out what's wrong with the following Sage / Pari-GP code

asked 2020-09-10 01:11:31 +0200

Basically, I would like to search for counterexamples to my conjecture that $$(2xy - \sigma(xy)) < (2x - \sigma(x))(\sigma(y) - y)$$ where $\sigma$ is the sum of divisors.

I tried using the following Pari-GP script in Sage Cell Server:

for(x=1, 100000, for(y=1, 100000, if(2*x*y-sigma(x*y) >= (2x-sigma(x))*(sigma(y)-y),print(x,"   ",y))))

However, it is returning the following error message:

***   syntax error, unexpected ')', expecting )-> or ',': 
  ***   ...-sigma(x*y)>=(2x-sigma(x))*(sigma(y)-y),print(
  ***                               ^---------------------

I did already check and verified that all the parentheses are in their proper places. I also checked for missing asterisks and verified that there are none.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2020-09-10 01:15:09 +0200

Got it! There was indeed a missing asterisk, after all!

The Pari-GP script should have been coded as such:

for(x=1, 100000, for(y=1, 100000, if(2*x*y-sigma(x*y) >= (2*x-sigma(x))*(sigma(y)-y),print(x,"   ",y))))

I am able to run this version of the script now.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2020-09-10 01:11:31 +0200

Seen: 265 times

Last updated: Sep 10 '20