set of formulas for computing all prime numbers

It might have helped if I had said these were for n >= 1, and omitting the smaller primes. Adding "15n + 3" and "15n + 5" (or adding "6n + 2" and "6n + 3") for n = 0 is required to get all the primes, but these greatly reduce the density of the list for n >= 1.

With that caveat, the list of "x" for a given "A" in "An + x" is the numbers that are co-prime with "A".

It is a consequence of the pattern, but not the pattern itself.

Reply to
David Brown
Loading thread data ...

Correct. Now figure out the list for 21n and 35n.

Reply to
David Brown

It's easy to make such lists automatically (I would call it an algorithm, rather than a formula, but it's still easy).

And as has been pointed out, a list of numbers that contains some primes and some non-primes is useless unless the density of primes is overwhelmingly large (and for any formula like this, the density /always/ decreases as you go further out), and/or the non-primes are of a form that their non-primality can be easily checked.

So nowhere in this process are you going to end up with something directly useful, and you are highly unlikely to come up with some new mathematical insight.

However, the whole process can be fun and educational for you as long as you are clear on that. And finding sequences that produce an unusually high prime density can be a very interesting challenge. The distribution of primes is, in effect, random - thus there is no end to the kind of patterns you can find, but the patterns you find will always break down when you stretch them far enough, and are never /rules/.

Finding sets of the form An + x is pretty much done - working with ever-greater values of A gets boring very quickly. Your next step, as I

  • Bn + C" arrangements. I would also target getting single formula, rather than a list, with an emphasis on prime density. Don't worry about including /every/ prime on the list - that is much less interesting.

But that's just /my/ idea of fun - it's your time you are spending, so it is your choice..

Reply to
David Brown

Sure I already wrote a computer program so its easy :D

Here it is for 21n:

1 2 3 4 5 7 8 10 11 13 16 17 19 20

Here it is for 35n:

1 2 3 4 5 6 7 8 9 11 12 13 16 17 18 19 22 23 24 26 27 29 31 32 33 34

I moved on to a better theory, ie primorial numbers have the fewest values in the above lists, and the list for primorial numbers is all primes smaller than the primorial number + all semiprimes smaller than the primorial number that have prime factors greater than the maximum prime factor of the primorial number.

At least I think that is correct, if not it is somewhat close to correct anyway. I would like to implement this into a function to find primes from 0 upwards, using a dynamic list of these values with the associated primorial numbers (ie. assign a new primorial number each time a new unique prime number is found)

cheers, Jamie

Reply to
Jamie M

Hi,

Interesting, I had thought for the A that are primorial that the list of 'x' are primes + semiprimes with factors greater than the primorial's largest factor. Probably a similar thing, but not exactly.

cheers, Jamie

Reply to
Jamie M

Here's an interesting fact. There is a real number theta such that floor(theta^(3^n)) is always prime for n = 1,2,...

formatting link

The last I heard [Hardy & Wright, 4th ed], it is a useless fact because to find theta with greater and greater accuracy one has to find larger and larger primes... But that was in 1960 and it may be that theta has been found by independent means since.

Reply to
Moufang Loop

Also

formatting link

Reply to
Moufang Loop

Hi,

That is cool, except it requires 185,000 digits in the constant in order to just calculate the first 13 primes in the sequence (since they are huge primes)

Mill's constant theta=1.306377883863080690...

Seems' like the constant just grows in length as required to match up with the next prime?

cheers, Jamie

Reply to
Jamie M

That formula just assumes there is at least one prime between x^3 and (x+1)^3 as far as I understand it, so formulas like that with x^4 or higher would work too I guess, showing that it is kind of pointless as the value of theta is just tuned to hit the primes, ie there is no way to find theta without knowing where the primes are, and there can be multiple theta's depending on which primes are hit.

cheers, Jamie

Reply to
Jamie M

Hi,

Thanks, I still am trying to figure out the pattern for highest prime density in a set of formulas for An + x

It turns out it is different that what I was guessing, ie the most prime dense formulas don't come from primorial numbers, but more generally from numbers with the most unique divisors I think.

This is based on finding the highest prime dense formula in the first 7000, and it has a value of 6930, and that has many unique divisors:

1, 2, 3, 5, 6, 7, 9, 10, 11, 14, 15, 18, 21, 22, 30, 33, 35, 42, 45, 55, 63, 66, 70, 77, 90, 99, 105, 110, 126, 154, 165, 198, 210, 231, 315, 330, 385, 462, 495, 630, 693, 770, 990, 1155, 1386, 2310, 3465, 6930

I don't know if it has the most unique divisors in the first 7000 numbers but wouldn't be surprised.

I need to check higher still to see the ordering of prime density functions to find the exact pattern as I was already wrong a couple times. :D

So for 6930, there are 1445 prime producing equations for it, out of the possible 6930 equations. The first 49 equations that produce primes for 6930 have coefficient values:

1,2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101, 103,107,109,113,127,131,137,139,149,151,157,163,167,169,173,179,181,191,193, 197,199,211

ie

1 + 6930n 2 + 6930n 3 + 6930n ... 139 + 6930n ...

These values very closely match the prime numbers, will all matches in that list with the exception of 169, which is the square of 13, and missing from the divisors of 6930, also the prime 17 is missing from the divisors, and I checked the square of 17, 289 is also in the list of values that produce primes for 6930.

So basically the best number for these formulas will have as many unique divisors as possible I guess that is the simple pattern.

So the performance of these equations is:

for:

17 + 6930n

this produces 72 primes out of the first 144 values for n.

That is the best I found yet, it is 50% primes.

The total number of primes found by all the 1445 prime producing equations is 78498 in the first 1million digits, which is all the primes. And the average number of primes found per prime producing equation is 78498/1445=54.323

So for all 1445 equations, they average a production of 54.323 primes out of the first 144 values for n. That is an average prime production rate of 37.7%.

So I think basically just having as many unique divisors is the key, and then the list of equation coefficients will more closely match the prime numbers, and there will be high prime density.

If I use a bigger number with tons of divisors, I should be able to get the percentage of primes found up quite a bit still, since the list of coefficients won't grow much.

cheers, Jamie

Reply to
Jamie M

I should add here are the top performing and worst performing values for 0 to 7000, ie a + 7000n sorted by the ratio of prime producing formulas they have to the value ie for 6930, it has

1445 prime producing formulas / 6930 = 0.208, the most prime dense formula of all 7000 (since 6930 seems to have the most unique divisors)

equation value , highest density sorted by ratio

6930 0.208513709 4620 0.208874459 2310 0.20995671 5460 0.211904762 2730 0.212820513 3570 0.216526611 3990 0.217794486 4830 0.219668737 6090 0.221510673 6510 0.221966206 4290 0.224941725 5610 0.229055258 6720 0.229166667 6300 0.229206349 5880 0.229251701

There are 999 different equations out of the first 7000 that have a ratio of 1, ie they have the lowest prime density, just the same as the actual number line. Here are some of them, they seem quite evenly spaced over the 7000 equations, I just put the first and last of them here:

equation value , lowest density sorted by ratio

1 1 2 1 3 1 5 1 7 1 11 1 13 1 17 1 19 1 23 1 29 1 31 1 37 1 41 1 43 1 ... 6899 1 6907 1 6911 1 6917 1 6947 1 6949 1 6959 1 6961 1 6967 1 6971 1 6977 1 6983 1 6991 1 6997 1

Here are some more equations out of the list of 7000 that have prime density ratios between those two above extremes of prime densities:

I think the pattern is that numbers with a higher ratio, ie approaching 1, have fewer divisors, so I guess if that is true, these tables are essential a divisor count index.

equation value , density sorted by ratio

6174 0.286200194 6048 0.286210317 5376 0.286272321 5292 0.286281179 4704 0.286352041 4536 0.286375661 3366 0.286393345 4116 0.286443149 ... 3010 0.336212625 5720 0.336363636 648 0.336419753 318 0.336477987 3290 0.336778116 576 0.336805556 282 0.336879433 2860 0.337062937 ... 4604 0.5 4612 0.5 4652 0.5 4684 0.5 4724 0.5 4748 0.5 4772 0.5 4804 0.5 ... 459 0.631808279 4617 0.632012129 4371 0.632120796 4611 0.632183908 3249 0.632194521 117 0.632478632 1539 0.632878493 5133 0.633352815 ... 203 0.837438424 2107 0.838158519 217 0.838709677 6409 0.839288501 2303 0.839774208 25 0.84 1859 0.840236686 ... 4859 0.96851204 5371 0.968534724 961 0.968782518 5617 0.968844579 3953 0.968884392 5699 0.96894192 4559 0.969072165 4187 0.969190351

cheers, Jamie

Reply to
Jamie M

That's all true - but remember that no matter what A and x you pick, the percentage of primes drops away rapidly as n increases. That means you are not finding anything useful here. It can be interesting to find patterns like this - and now you have found out a lot about the patterns for the simple formula An + x. Measuring samples for ever-higher values of A and x will not teach you anything new.

Reply to
David Brown

Of course it isn't useful its math, however I do plan on getting to

100% prime output up to a certain range, ie maybe beat n^2+n+41, which gives primes for the first 40 consecutive integers.

With that last formula I posted 17 + 6930n, it gives primes for like the first 12 or something, so I have a ways to go still, but should be doable I'd say. A will be a lot larger though.

Here is a list of prime generating polynomials:

formatting link

Also mentions:

"Jones, Sato, Wada, and Wiens have also found a polynomial of degree 25 in 26 variables whose positive values are exactly the prime numbers (Flannery and Flannery 2000, p. 51)."

cheers, Jamie

Reply to
Jamie M

"for any k there exists a pair of a and b with the property that L(n) = an+b is prime for any n from 0 to k ? 1." from

formatting link

This is the result I referred to elsdewhere.

Reply to
Moufang Loop

Actually I think there is a principle that I found too...

ie. *new* prime numbers are found much more often when *known* smaller prime numbers added to numbers that have many unique divisors.

This means that a *new* prime number will be found more often when added to a number that can be expressed in many possible ways more often than when the number can only be expressed in few ways.

So this implies that the unknown future occurrence of a prime number appearing is related to how many unique divisors (how many configurations the number has) of the number that is added to the small prime.

This is like the analogy of collapsing a wave function to get a specific value of a new prime. The wave function is the integer multiple of a number with many unique divisors, and the seed is a small prime. The complexity or information is proportional to the unique divisors of the number, which are all different beat frequencies in a wave function analogy for example.

The question is why is a system like that more likely to create a new prime number when an existing known smaller prime is added to it, compared to a system with fewer unique divisors or beat frequencies by analogy.

On a 2d graph of unit squares, with zero for X and Y at the origin, all squares of primes (ie 7^2=49) are on the diagonal, so this is the only line that primes can be found, on the diagonal.

For numbers with many unique divisors, they form many rectangles on this graph representing different ways to multiple to the number, ie for the number 24, which has unique divisors:

1, 2, 3, 4, 6, 8, 12, 24

It is represented by rectangles:

2x12 3x8 4x6 12x1

For numbers with only a few unique divisors, there are less rectangles on this graph for them.

ie for the number 25, which has unique divisors:

1, 5, 25

It is represented by rectangles:

1x25 5x5

All primes are squares on this graph, and all numbers with many unique divisors have a lot of non-square rectangles, and maybe no squares not sure, but I think that since the orientations with many non-square rectangles produce more primes, it must be because there is a way to organize the unique divisors to match the coordinates of the prime that is created.

ie for the simple formula 5+6n

6 has unique divisors: 1,2,3,6

and the formula finds the prime number 23 with

5+6(3)

So the number here that is added to the prime is 18, and it has unique divisors:

1, 2, 3, 6, 9, 18

These can be arranged on the X Y graph to give the X Y coordinates of the square for the prime 23, by adding up the different divisors, ie 18+3+2=23

This shows there is an interference in the wave function analogy that allows a new frequency to be created, when the small prime 5 (seed frequency analogy) is added.

So to find primes at a certain value, the unique divisors should be able to sum up to that value.

This idea will take work to verify right now it is just brainstorming.

cheers, Jamie

Reply to
Jamie M

Hi,

Wow thanks for that link, that's what I've been working on too :)

I wonder how many unique divisors that value of a has from the wiki page:

5283234035979900

If what I was saying is true it should have way more than average unique divisors compared to other similar sized numbers.

Also for the b value, 43142746595714191 I guess that is prime :)

Ya I remember you posting it, thanks.

cheers, Jamie

Reply to
Jamie M

Hi,

From the related page on that:

formatting link

It looks like they are finding these formulas with brute force:

"The proof of the Green?Tao does not show how to find the progressions of primes; it merely proves they exist. There has been separate computational work to find large arithmetic progressions in the primes.

24 primes in arithmetic progression:[4]

The constant 223092870 here is the product of the prime numbers up to 23 (see primorial).

case of 25 primes:

Reynolds in a distributed PrimeGrid project found the first known case of 26 primes (sequence A204189 in OEIS):

  1. "

So they say they don't know how to find the progression of primes, but really using that best formula they show:

is a number with very high unique divisor count, and

43,142,746,595,714,191 is a prime, it is larger than

5,283,186,672,439,900 though so is different from the one I'm doing.

But I would guess that 5,283,186,672,439,900 has a lot of unique factors anyway..

I think it is possible to find smaller numbers than these with 25 consecutive primes though.

cheers, Jamie

Reply to
Jamie M

2^2 3 5^2 7^2 11 13 17 19 23 373 907 (14 prime factors, 11 distinct) says Wolframalpha.

Yes.

Reply to
Moufang Loop

2^2 5^2 7 373 907 22309087 (8 prime factors, 6 distinct) says Wolframalpha.
Reply to
Moufang Loop

Hi,

I think the special thing about that number I found 6930, which produces the most primes for all numbers up to 7000 is that it is very similar to a primorial number, as well as having a lot of unique divisors.

6930 close to primorial:

2 * 3^2 * 5 * 7 * 11

6930 unique divisors:

1, 2, 3, 5, 6, 7, 9, 10, 11, 14, 15, 18, 21, 22, 30, 33, 35, 42, 45, 55,

63, 66, 70, 77, 90, 99, 105, 110, 126, 154, 165, 198, 210, 231, 315, 330, 385, 462, 495, 630, 693, 770, 990, 1155, 1386, 2310, 3465, 6930

cheers, Jamie

Reply to
Jamie M

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.