which is exactly 1000 digits. You wouldn't even need to generate primes- you could just use a list of already-known ones, and if you want a bigger number, tack on the next few primes.
https://primes.utm.edu/lists/small/10000.txt is a list of the first 10000 primes, delimited by spaces and newlines. Copy-paste it into a document, save, and you can now generate primes up to... an absurd amount of digits.
At a minimum, this at least gives you a known prime of 1000 digits. Using various primality tests and the like, it should be reasonable to get to other primes relatively quickly from here.
So, shadow you meant your sieve program is 125 bytes. Well done!
My comment relates to the size of sieve[j] and decimal rather than binary. But that's not an issue for me now that I understand where you're coming from. The non division confirmation is there to see too!
Ispil clearly demonstrates the ease by other means to get 1000 digits. The sieve would have a lot of trouble getting there I claim.
I meant the bitset itself takes up 125 bytes, but that was an error on my part, the bitset takes 1250 bytes to find 1231 primes, which will then have a product of more than 3000 digits long, so it is less than that much.
But, I think your original point stands. The size of the sieve required is not all that large.
There is a lot of difference between the storage for a trivial binary exercise that takes the first couple of prime numbers up to < 8000 and extrapolating that to 1000 digit numbers!
A little searching reveals Euclid's Theorem which relies on this concept to show that there are infinitely many prime numbers. But that's a different thing, the theorem does not claim to generate prime numbers.
However, if p and q are prime then ( p * q ) + 1 is not prime except in the cases where it is prime or otherwise fits in or out. Maybe this is where the misinterpretation comes from. Sounds good anyway.
No, it wouldn't be prime- it would be relatively prime to p and q. Not the same thing. The misinterpretation was that I didn't realize that it was saying that N (product of all p<n)'s prime factors are all greater than n, not that N has only itself as a prime factor.
Natural numbers, but yeah; that's tautologically true. Primes are products of themselves and one; one is a natural number, and themselves are natural numbers. Hence, they are the product of natural numbers.
As for your correction to your post, it's also rather silly. "x is not prime except in the cases where it is prime..."
I think it's rather safe to say that primes are as unpredictable as we expect them to be.
Don't take life too seriously. Just think there's probably a billion or so chinese who don't know about this discussion and even if they did I doubt they'd give a shit.