Loading ...
Sorry, an error occurred while loading the content.

Re: sum_divisors=sum_antidivisors

Expand Messages
  • djbroadhurst
    Off-list, Max B asked for my code for this exercise. For what it s worth, this was it: {SA(n)=local(o);o=n;while(o%2==0,o=o/2);
    Message 1 of 2 , Sep 2, 2002
    • 0 Attachment
      Off-list, Max B asked for my code for this exercise.

      For what it's worth, this was it:

      {SA(n)=local(o);o=n;while(o%2==0,o=o/2);
      sigma(2*n+1,1)+sigma(2*n-1,1)+sigma(o,1)*2*n/o-6*n-2}
      for(n=1,10^5,if(sigma(n,1)==SA(n),print(n)))

      But I did no sanity check!

      David
    Your message has been successfully submitted and would be delivered to recipients shortly.