These two sets of formulas will produce no prime numbers from n=0 to n=infinity, except for primes 2 and 3 in set1, and prime 2 in set2.

The interesting ones are with odd numbers, as the even numbers are easy to see they don't produce primes, but the odd ones not producing primes is pretty interesting.

set1:

2+6n (produces a single prime 2)
3+6n (produces a single prime 3)
4+6n
6+6n

That formula has the fewest integer coefficients of any other values less than 210 to generate all the primes.

Another example with even more dense primes in the formulas:

product of primes ie: 2*3*5*7*11*13*17*19*23*29 =6469693230

integer coefficient+6469693230n

That formula has the fewest integer coefficients of any other values less than 6469693230 to generate all the primes.

See the pattern! :D

Basically if you take the full set of all infinite prime numbers, and take the product of all of them combined, then make a formula with that like the above, you will still have the best ability to generate all the primes with the highest occurrence density.

Here's some output of ratios of how many of the formulas for a given n are prime, ie for n=30 below, 0.36666.. or

11 out of the 30 (11/30=0.3666..) formulas produce primes.

The formula with the lowest ratio's produce the most primes, so for n=210 below (product of primes 2*3*5*7), less than a quarter (0.247619048) of the 210 possible formulas produce primes, ie 52 formulas produce primes for n=210.

This ratio should decrease further for bigger products of primes, ie as above:

product of primes ie: 2*3*5*7*11*13*17*19*23*29 =6469693230

So based on what I find for other numbers with the lowest ratios, like 840 has, I will narrow it down to see which of those three are important for this formula.

Interesting that page says: "Phi(n)/n is a new minimum for each primorial. - Robert G. Wilson v, Jan

10 2004"

"Smallest number stroked off n times after the n-th sifting process in an Eratosthenes sieve. - Lekraj Beedassy, Mar 31 2005"

"Apparently each term is a new minimum for phi(x)*sigma(x)/x^2. 6/Pi^2 < sigma(x)*phi(x)/x^2 < 1 for n > 1. - Jud McCranie, Jun 11 2005"

" The peaks (i.e., local maximums) in a graph of the number of repetitions (i.e., the tally of values) vs. value, as generated by taking the differences of all distinct pairs of odd prime numbers within a contiguous range occur at regular periodic intervals given by the primorial numbers 6 and greater. Larger primorials yield larger (relative) peaks, however the range must be >50% larger than the primorial to be easily observed. Secondary peaks occur at intervals of those "near-primorials" divisible by 6 (e.g., 42). See A259629. Also, periodicity at intervals of 6 and 30 can be observed in the local peaks of all possible sums of two, three or more distinct odd primes within modest contiguous ranges starting from p(2) = 3. - Richard R. Forberg, Jul 01 2015 "

Looks like I finally found what I'm doing, assuming this is the matching sequence.

ie for the last one, the equation 2309 + 2310n for n=0 to n=432 produces 166 primes, pretty decent ratio, that's a 38.4% chance for each value to be prime in that range up to n=432, ie primes up to 1million.

All of those equation coefficients produce similar occurrences of the primes, so all primes up to 1million can be calculated with the set of these formulas with about 38.4% +- a couple percent occurrence.

Also someone said before "what is the point of this if you have to calculate all these coefficients first anyway" well for these special numbers, ie 2310, I think there might be a formula to generate the big list of coefficients above, as there is a quite periodic pattern between the coefficient values. Here is the spacing for the above coefficients:

Maybe comparing these spacings with other values besides 2310 can show the overall formula, then if that is found it should be easier to calculate primes. It's possible there is no pattern that can be found in the spacing too, in fact these special numbers, ie 2310 might just have a more noisy spacing of coefficients than the less useful values which have lower prime density.

If anyone sees a pattern in there though let me know :D

I realize now that the list of prime generating coefficients for 2310, is *almost* just the sequence of prime digits, except for 169, and some semi-primes 221 in there etc..

So I am pretty sure that if instead of using 2310, I use a REALLY big number with the same properties, ie assuming the important property is

2310 being primiorial:

formatting link

then the biggest one listed on that page is: 557940830126698960967415390 so that is the new formula to use, and now since it is such a big number I hypothesize that the sequence of prime generating coefficients for it, are going to be a lot closer to the actual sequence of prime numbers, with fewer semi-primes in there..

So now there is at least a formula to calculate the set of coefficients to generate prime numbers at really big scales.

ie:

7 + 557940830126698960967415390n for n=0 to n=infinity

this formula should have really good prime number density (compared to just doing a brute force prime number search) up to maybe

10^30 or something like that. To calculate all primes using that formula it is the sequence of these formulas (except for possible errors of coefficients that are coprimes being excluded)

Calculating all the primes up to 557940830126698960967415390 is still a lot of calculating, but then once they are calculated, then even more primes can be found using that primorial set of formulas.

Primorial numbers ie 2310, have more distinct prime factors than any number smaller than it. Yet Y in this case, ie 7 has the common factor (of itself) with 2310.

The best formula to find the most primes I found so far is:

most likelihood of being prime = a prime below the primorial + (primorial)n

So given a very large number that you don't if it is prime or not, this algorithm (with arbitrary precision math) should be able to quickly see if the number is prime without doing any factorization? Is that right, and are there other algorithms that can do this?

Actually that is even better, I think I made an error in my code to select these functions as prime producing based on the fact that they produce a single prime.. but if that is true that these formulas produce no more than a single prime, then the new formula excluding the single prime is:

NOT_prime = a prime below the primorial + (primorial)n

Can that formula be used to check if a very large number is prime?

ie. try to subtract integer multiples of primorial numbers from a very large number, and if the result is prime then the very large number isn't prime maybe. ie 9247-2310*4=7

less than this number divides the original number evenly, if not you have a prime. This may be considered brute force. however.

Hi,

Actually that above formula I wrote is wrong, ie for

Y + 2310n, all prime producing functions (that produce more than a single prime) have Y as a prime larger than 11, since 2310 = 2*3*5*7*11.

So my formula before is correct, Y tends to be always prime the bigger then primorial number is, but for Y less than the primorial largest prime factor (ie 11 for 2310) then there is only one prime produced, but larger primes than the largest primorial factor produce many primes.

ie for 13 + 2310n, there are 164 primes produced for n up to 432

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here.
All logos and trade names are the property of their respective owners.