in reply to Re^2: ulam's spiral too slow
in thread ulam's spiral too slow
Thanks for catching that. I just noticed the bug in my code, which is: although I'm caching prime numbers, I'm not testing all of them as potential factors.
s''(q.S:$/9=(T1';s;(..)(..);$..=substr+crypt($1,$2),2,3;eg;print$..$/
I'll go update the code now, but you're right; there needs to be a check for division by 2.
s''(q.S:$/9=(T1';s;(..)(..);$..=substr+crypt($1,$2),2,3;eg;print$..$/
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: ulam's spiral too slow
by orange (Beadle) on Apr 17, 2007 at 07:22 UTC |
In Section
Seekers of Perl Wisdom