Hi Rodolfo,<div><br></div><div>Thanks for the suggestion. I ended up reading quite a bit about generators and found this very appropriate and interesting page:</div><div><a href="http://matthias.benkard.de/journal/116">http://matthias.benkard.de/journal/116</a>.</div>
<div><br></div><div>-Joe<br><br><div class="gmail_quote">On Sun, Feb 19, 2012 at 7:05 PM, Rodolfo Carvalho <span dir="ltr"><<a href="mailto:rhcarvalho@gmail.com">rhcarvalho@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im"><div class="gmail_quote">On Mon, Feb 20, 2012 at 00:55, Joe Gilray <span dir="ltr"><<a href="mailto:jgilray@gmail.com" target="_blank">jgilray@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Rodolfo,<div><br></div><div>Thanks for the suggestions. Your re-factoring (no pun intended) of the conds really cleaned things up. Much appreciated.</div><div><br></div><div>About the unnecessary loops, good point, I simply changed to starting with end set to 10 instead of 1000 and I think that helps a lot. I know that there are other gross inefficiencies as well (for example, if primes-from-to gets called to just add a few primes to the list it is very slow as it goes through the whole list. A better implementation would "know" that the values on storedlst are already checked and skip checking them.<br>
</div></blockquote></div><br><br></div>Maybe you could generate the list of primes using... hmm.. Generators!<br><br><a href="http://docs.racket-lang.org/reference/Generators.html" target="_blank">http://docs.racket-lang.org/reference/Generators.html</a><br>
<br>You could have something like (primes-up-to n) yield one prime at a time, up to n (the number to be factored).<br><br><br>[]'s<span class="HOEnZb"><font color="#888888"><br><br>Rodolfo Carvalho<br>
</font></span></blockquote></div><br></div>