On Thu, Aug 4, 2011 at 4:01 AM, Steven D'Aprano <steve+comp.lang.pyt...@pearwood.info> wrote: > a, b = divmod(n, i) > if b == 0: > total += a+i >
Wouldn't this fail on squares? It happens to give correct results as far as I've checked; no square up to 10,000 is called perfect, and there are no perfect squares in that range, but I think it's technically using an incorrect intermediate result. ChrisA -- http://mail.python.org/mailman/listinfo/python-list