[Tutor] OverflowError: cannot fit 'long' into an index-sized integer

Danny Yoo dyoo at hashcollision.org
Tue Jan 7 22:32:51 CET 2014


Hi Keith,

Ah, good point.  I did not realize that we could use a sqrt() to get a
good upper bound on what primes we can consider.  That cuts down on
the size of the search space enormously.  Ok, I take my objection back
then.

(That being said, I'm fairly certain that this problem can be solved
in constant space, without maintaining an explicit sieve.)


More information about the Tutor mailing list