I have given the definition of lucky numbers and constraints involved at the starting of the thread. when a number's sum of digits and square of sum of digits is prime,it is called lucky.
I already tried generating prime numbers using sieve of atkin algorithm rather than doing primality test. Efficiency improved a lot but still couldnt reach 16 sec target. The large numbers are the only hindrance to the speed. Since i m new to Python.I dont know all its recipes and tricks inlvolved to "charm-the-snake". So can i improve the islucky method more than what i mentioned before? Can i work around that way in python or should i come up with a new algorithm?
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor