On Nov 16, 2005, at 11:53 AM, Peter wrote: > >>>> (Only the same 8 numbers within any given 30 sequentially numbered >>>> group are potentially prime). >> >>> Except for 0 to 30, which has 10 or 11 primes (depending on how you >>> feel about "1") ? Even without 2, there are still more than 8 >>> primes. >> >> Error 314159: Invalid range specified Range 0 - 30 contains more >> than 30 numbers. Ok. Since the algorithm acts on (N*30)+..., I guess we're talking about the range 0 to 29 for N=0. It's still got more than 8 odd primes (3, 5, 7, 11, 13, 17, 19, 23, 29) plus 2, of course... Looks like the trouble makers are 2, 3 and 5; the algorithm says "(N*30) has those factors for all N and therefore can't be prime, but the N=0 case is special cause it's the ONLY factor... In my own "find the prime numbers" program, I didn't bother remembering the non-prime numbers; I just tested all the odd numbers against the list of primes I already had. I wonder where the break-even point in storage is... It was a very educational experience, The main thing I learned was that actually outputting the primes was MUCH more expensive than merely calculating them and leaving them in memory. (IIRC, I only calculated the first 100k primes.) I wonder where the break-even point for THAT was. thousands of instructions to do that IO system call, vs 1 (none, really) to leave the prime sitting in memory... BillW -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist