Thread: Idea for faster sieve View Single Post
2007-05-28, 02:53   #30
geoff

Mar 2003
New Zealand

22058 Posts

Quote:
 Originally Posted by Citrix Assume that p-1%720=20 Then I want to look at ar[10-1], since the values in the array are 2,4,6,8... ie they start at 2. So the ar[9]=20.
What if (p-1)%720 = 0? Then ar[0-1] is junk.

Quote:
 Is there anything else that could be going wrong? Are you sure returning j=0 causes the prime to be skipped.
setup64() is called like this from prime_sieve() (in primes.c):
Code:
cc = setup64(p);
if (cc > 0)
bsgs64(p,cc);