Oops, realized after posting that there's a bug in my code - it returns 1 for a perfect square. Need another check in the 'while' loop, thus:
On Wed, Jun 22, 2011 at 8:59 AM, Chris Angelico <ros...@gmail.com> wrote: > exec 600851475143; for (int i=2;i<ret;++i) while (ret%i==0 && ret>i) ret/=i > > while not ret%i and ret>i: Definitely room for improvement here! ChrisA -- http://mail.python.org/mailman/listinfo/python-list