[Tutor] OverflowError in lucky numbers script
marc.tompkins at gmail.com
Mon Jan 23 20:42:08 CET 2012
On Mon, Jan 23, 2012 at 10:51 AM, Shreesh bhat <shreeshbhat90 at 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
So, if I understood your definition, here are the lucky numbers up to 10^18:
It seems to me that the problem can't possibly be that simple, so I must
have misunderstood your definition. Please explain!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tutor