1 Replies - 525 Views - Last Post: 27 March 2009 - 06:24 AM

#1 atik97   User is offline

  • ???
  • member icon

Reputation: 144
  • View blog
  • Posts: 715
  • Joined: 16-September 08

Sum Of Divisors

Posted 26 March 2009 - 02:25 PM

Description:
def divisors(n)
  sumOfDivisors=0
  i=1
  while i
						
						
Is This A Good Question/Topic? 0
  • +

Replies To: Sum Of Divisors

#2 NickDMax   User is offline

  • Can grep dead trees!
  • member icon

Reputation: 2255
  • View blog
  • Posts: 9,245
  • Joined: 18-February 07

Re: Sum Of Divisors

Posted 27 March 2009 - 06:24 AM

You should be able to speed this up since you can use the current divisor to find another, and you should then only have to check between 1 and sqrt(n) rather than n.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1