Quote:
Originally Posted by masque de Z
Yes absolutely we agree that what i said is fine tuned for 5 digits (~60%) even say up to 10 digits wont be bad probably near >35%+ success rate (as a test suggested for an appropriately redeveloped similar scheme) for the number produced to be prime even up there but as you go higher it will continue dropping because the process eliminates only the first few primes as divisors and it grows real fast before using enough of them and lots of composites with bigger than eliminated prime factors exist, a situation that gets worse as you go higher.
However i maintain for the purposes i thought it first (ie typical less than 10 digit numbers its fairly good and in terms of using a hand held calculator faster than all other ideas so far seen even if computationally more intensive its effectively faster processed. Otherwise if we go to programming clearly we can start using advanced primality tests as well.
I've been trying to figure out if there's a meaningful way to look at how one might view "success" for your algorithm.
Let's look at your formula: 19* Prime[9 + n]*2 + 3*5*7*11*13
This formula is guaranteed not to be a multiple of 2, 3, 5, 7, 11, 13, or 19 plus one more prime for all n. (You skipped 17, probably for no particular reason, but it would be easy enough to include.) I'm curious if this is any more successful than doing an Eratosthenes sieve for primes up to 19, and then just picking a random number that hasn't yet been crossed out yet. I suppose it might do slightly better because you're always guaranteed one more prime in your construction than the sieve, but since that prime is changing and has a computational cost of finding it, I would consider that to be a wash.
Maybe a way of making the comparison is to compare your idea against mine by picking out the same primes, so that you have a new formula like
3*5*11+2*Prime[n + 5] -- Or rearranged however you wanted to do it
(Notice that you can extend my scheme to any number of digits, so we can look in an unbounded manner.) If they are very comparable, then it wouldn't seem that there's anything particularly advantageous to your scheme. It's basically the same as just removing some candidates for small primes and picking randomly from what's left.