[Tutor] OverflowError in lucky numbers script

Marc Tompkins marc.tompkins at gmail.com
Tue Jan 24 05:28:45 CET 2012


On Mon, Jan 23, 2012 at 8:03 PM, Dave Angel <d at davea.name> wrote:

> On 01/23/2012 10:31 PM, Marc Tompkins wrote:
>
>> On Mon, Jan 23, 2012 at 12:08 PM, Shreesh bhat<shreeshbhat90 at gmail.com>**
>> wrote:
>>
>>  No,i meant sum of digits is prime and also sum of square of digits is
>>> prime.
>>> E.g: 23 is lucky cos
>>> 2+3=>5 (prime)
>>> 2**2+3**2 =>  4+9 =>  13 (prime)
>>>
>>>  Thanks for the clarification - or I should say "correction", since "sum
>> of
>> square of digits" and "square of sum of digits" are NOT equivalent!
>>
>>  But Shreesh' original wording was:
>
>
> A number is called lucky if the sum of its digits, as well as the sum of
> the squares of its digits is a prime number. How many numbers between A and
> B are lucky?
>
> in a message 1/22/12 at 1:11, subject: "Re: [Tutor] Tutor Digest, Vol 95,
> Issue 55"
>
> That thread soon got renamed to "OverflowError in lucky numbers script"
>
> Yes, but I - and apparently others - missed that thread; someone (Steven
D'Aprano?) asked for a re-statement of the problem; the re-statement (which
was the first time I'd seen the problem definition) was confusing.  Sorry
for starting a false trail; sorry for jumping in late.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20120123/af25a1a3/attachment.html>


More information about the Tutor mailing list