<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Dec 11, 2012, at 6:01 AM, Jens Axel Søgaard wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>For a small (less than 10000) number n prime? looks up primality of<br>with a simple (vector-ref small-primes n).<br><br>For a large number (greater than 10000) a pseudo prime test is used.<br><br>Originally the limit for small primes was a million, but that limit is too<br>large for a general purpose library.<br></div></blockquote></div><div><br></div>Would it perhaps make more sense for small-primes to contain primes themselves, in increasing order so one can be found by binary search, rather than booleans? The O(1) behavior would be replaced by O(log(limit)), but perhaps you would save enough memory to put the limit higher.<div><br><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div>Stephen Bloch</div><div><a href="mailto:sbloch@adelphi.edu">sbloch@adelphi.edu</a></div><div><br></div></span><br class="Apple-interchange-newline">
</div>
<br></div></body></html>