On Mon, Jan 23, 2012 at 10:51 AM, Shreesh bhat <shreeshbha...@gmail.com>wrote:
> 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. > Just to clarify: do you mean "(sum of digits) + (sum of digits)^2"? If so, the ONLY lucky numbers are those whose digits add up to 1... because "x + x^2" is always even (for real integers), and 2 is the only even prime number. So, if I understood your definition, here are the lucky numbers up to 10^18: 1 10 100 1000 ... 10000000000000000 100000000000000000 1000000000000000000 It seems to me that the problem can't possibly be that simple, so I must have misunderstood your definition. Please explain!
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor