Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫  π  -¹ ² ³ °

You are not logged in.

## #1 2020-05-11 16:51:54

Knewlogik
Guest

### All primes formula

Okay I'll check the number 7 and the number 11 and when adding 6 to these numbers it will give you all primes after but the downfall here and there you left a few oddball numbers in between how do I figure out a way to pull the oddball numbers out are what formula would tell me how to obtain the oddball numbers but yet leave the prime ones so I can determine why those oddball numbers are there

## #2 2020-05-11 21:02:13

Bob
Administrator
Registered: 2010-06-20
Posts: 8,909

### Re: All primes formula

hi Knewlogik

Welcome to the forum.  you've made two similar posts so I'll try to deal with both here.

If you start with 7 and keep adding 6 you get:

7,   13,   19,   25,   31,   37,   …..

Starting with 11 gives:

11,   17,   23,   29,   35,   41,   …..

Will you ever get the same number in both lists?  No; it'll never happen.

Because the two lists start 4 apart and both go up at the same rate, they never share a value.

Do you know about straight line graphs?  If not look here:

https://www.mathsisfun.com/equation_of_line.html

The first sequence has equation y = 7 +6x.  The second is y = 11 + 6x

These two lines have the same gradient (6) so they are parallel.  So they never cross.

For many, many years mathematicians have tried to find a formula for generating primes.  There are a few that give some primes, and many that look like they are working but then fail, but nobody has yet come up with a formula for all primes.  I suspect it doesn't exist but I don't think there is a proof that no such formula exists.

Best wishes, keep safe,

Bob

Children are not defined by school ...........The Fonz
You cannot teach a man anything;  you can only help him find it within himself..........Galileo Galilei
Sometimes I deliberately make mistakes, just to test you!  …………….Bob

Offline

## #3 2020-05-11 22:50:10

Knewlogik
Member
Registered: 2020-05-11
Posts: 18

### Re: All primes formula

bob bundy wrote:

hi Knewlogik

Welcome to the forum.  you've made two similar posts so I'll try to deal with both here.

If you start with 7 and keep adding 6 you get:

7,   13,   19,   25,   31,   37,   …..

Starting with 11 gives:

11,   17,   23,   29,   35,   41,   …..

Will you ever get the same number in both lists?  No; it'll never happen.

Because the two lists start 4 apart and both go up at the same rate, they never share a value.

Do you know about straight line graphs?  If not look here:

https://www.mathsisfun.com/equation_of_line.html

The first sequence has equation y = 7 +6x.  The second is y = 11 + 6x

These two lines have the same gradient (6) so they are parallel.  So they never cross.

For many, many years mathematicians have tried to find a formula for generating primes.  There are a few that give some primes, and many that look like they are working but then fail, but nobody has yet come up with a formula for all primes.  I suspect it doesn't exist but I don't think there is a proof that no such formula exists.

Best wishes, keep safe,

Bob

1,2,3,4,5,6
7,8,9,10,11,12
13,14,15,16,17,18... Now pretend that this is an infinite row that continues downward but instead of stopping at the tent position we're stopping at the sixth position and starting over Seven second line but would normally be the 10th position is now the 7th position and while adding 6 to the 7th line and where the position 7,11 is lying you will forever have all primes with some extras correct ex 07,13,19,25,31,37...       11,17,23,29,35,41,47... Does that make more sense now if you have graph paper you have all those numbers inside of each box with what he leaves you with is a straight line down both 11 and 7 throw with all primes including a couple extras how do I do window out the non primes

Offline

## #4 2020-05-12 00:12:50

Bob
Administrator
Registered: 2010-06-20
Posts: 8,909

### Re: All primes formula

hi Knewlogik

I've used a spreadsheet to create a large set of data.

If I label the columns by the first number, ie. 1 2 3 4 5 and 6, then the 2, 4, and 6 columns are always even and so  will never produce primes.  Similarly the 3 column always gives numbers that are divisible by 3, so will not be primes.

So the 1 and 5 columns are the ones to look at and that's the ones you are talking about … good so far.

Looking at the 1 column, we have

1,  7,  13,  19,  25,  31,  37,  43,  …….

From 7 onward we do appear to be getting a lot of primes, but also some that are not, such as 25.  You want to know if these can be easily removed from the list.

Well numbers that are divisible by 5 do keep appearing: 25,  55,  115,  145,  and so on.  We could remove these by testing for divisibility by 5.  Notice that they occur regularly down the column.

But there are also some that are divisible by 7:  49,  91,  133,    175, and so on.  Once again these occur at regular intervals.

Once again we could eliminate these by checking for divisibility by 7.

But there are also some that are divisible by 11: 55,  121,  187 and so on.  Again at regular intervals.

Will this ever stop happening?  Sorry but no.  There are numbers in the column that are divisible by 13, 17, 19, 23 and so on.  In fact every prime will eventually be a divisor for some number in the column,

I have a way of proving this but it involves some more advanced mathematics.  I'll try to explain it if you would like.

And the same is true for the 5 column.

Thus there is no easy way to remove the unwanted non primes.  Sorry.

Look up the Sieve of Eratosthenes and you'll see that what you have devised is very similar.  It works, but you have to keep eliminating numbers by removing those that are divisible by a known prime.

Bob

Children are not defined by school ...........The Fonz
You cannot teach a man anything;  you can only help him find it within himself..........Galileo Galilei
Sometimes I deliberately make mistakes, just to test you!  …………….Bob

Offline

## #5 2020-05-12 11:36:44

Knewlogik
Member
Registered: 2020-05-11
Posts: 18

### Re: All primes formula

What is the first prime it misses?

Offline

## #6 2020-05-12 19:36:33

Bob
Administrator
Registered: 2010-06-20
Posts: 8,909

### Re: All primes formula

hi Knewlogik

169 won't be removed by dividing by 5, 7 and 11.  That led me to a general result:

Consider the number p^2 where p is any prime > 3.

This number is not a prime as it has more than 2 factors {1, p, p^2}.

It's odd so it won't be in columns 2, 4, or 6.

It isn't divisible by 3 so it's not in column 3.

Therefore it is in column 1 or 5.

Even if you have removed all non primes with prime factors, each of which is less than p, the number p^2 won't have need detected yet.

So, there is no highest prime that can be used to check division and remove all non primes.

Bob

Children are not defined by school ...........The Fonz
You cannot teach a man anything;  you can only help him find it within himself..........Galileo Galilei
Sometimes I deliberately make mistakes, just to test you!  …………….Bob

Offline

## #7 2020-05-19 15:09:20

Knewlogik
Member
Registered: 2020-05-11
Posts: 18

### Re: All primes formula

Wouldn't it just be easier to eliminate any number that didn't end with 1,3,7,0r 9?? Then do you lr division thing

Offline

## #8 2020-05-19 20:59:57

Bob
Administrator
Registered: 2010-06-20
Posts: 8,909

### Re: All primes formula

hi Knewlogik

It was your method.  I'm just commenting on it.  As far as I know, there is no simple way to generate all primes from an algorithm other than the following:

(1) Start the primes list with {2}

(2) Consider the next candidate.  This can be 3 initially and then every odd number thereafter.

(3) Test whether any of the numbers in the primes list divide into the number under test.

(4) If they do continue to the next candidate number and repeat step 3.

(5) If not, then the number is also a prime and should be added to the primes list.

You can short cut slightly by eliminating any candidate number that ends in 5.

You can also cutdown on the number of divisions by using the fact that if f is a factor of N below square root(N) then  N/f is another factor that is above the square root.  Thus if you haven't found a factor by the time you reach square root(N) you can safely stop looking.

The Sieve of Eratosthenes involves eliminating non primes by going through a table of numbers crossing out every number divisible by each prime except that number and looking at what remains.  When I taught this I used a grid with 1 - 10 on the top row, then 11 - 20, then 21 - 30 and so on.  This makes it easier to cross out certain candidates such as the whole of the 15, 25, 35 … column.  Factors of three make a satisfying diagonal pattern etc.

But it doesn't provide a way to get all the primes, as you have to keep extending the grid and testing for division by larger and larger primes.

I think your idea amounts to the same thing; just a different grid shape; which helps to cut out more non primes more quickly. Unfortunately the issue of 'when can I stop crossing out non primes' still arises, as with Eratosthenes. The answer is never!

Bob

Children are not defined by school ...........The Fonz
You cannot teach a man anything;  you can only help him find it within himself..........Galileo Galilei
Sometimes I deliberately make mistakes, just to test you!  …………….Bob

Offline

## #9 2020-06-08 23:56:10

Knewlogik
Member
Registered: 2020-05-11
Posts: 18

### Re: All primes formula

Well I've been crunching numbers and I figured out a way to pull the pr do I have an answer for the primes problem now all you have to do is take the number 2520 and divided by any number that is two digit add another zero if you want to do three digits add another zero if you want to do for digits add another zero if you want to do 5 digits and if the denominator of the mixed fraction is the same as the number you divided into my special number then it is a prime bottom line I've tried every prime so far has worked  example 25200/101=.             249 51/101.  just ignore the rest of the number and noticed the denominator is 101 so therefore it must be prime and only then is it prime

Last edited by Knewlogik (2020-06-08 23:58:41)

Offline

## #10 2020-06-09 00:00:05

Knewlogik
Member
Registered: 2020-05-11
Posts: 18

### Re: All primes formula

Knewlogik wrote:

Well I've been crunching numbers and I figured out a way to pull the pr do I have an answer for the primes problem now all you have to do is take the number 2520 and divided by any number that is two digit add another zero if you want to do three digits add another zero if you want to do for digits add another zero if you want to do 5 digits and if the denominator of the mixed fraction is the same as the number you divided into my special number then it is a prime bottom line I've tried every prime so far has worked  example 25200/101=.             249 51/101.  just ignore the rest of the number and noticed the denominator is 101 so therefore it must be prime and only then is it prime

Prayer changes things and gives results

Offline

## #11 2020-06-09 00:21:39

Bob
Administrator
Registered: 2010-06-20
Posts: 8,909

### Re: All primes formula

hi Knewlogik

I've read and re-read this many times but I'm still not getting it.

Please give some more examples, explaining each step.

Thanks,

Bob

Children are not defined by school ...........The Fonz
You cannot teach a man anything;  you can only help him find it within himself..........Galileo Galilei
Sometimes I deliberately make mistakes, just to test you!  …………….Bob

Offline

## #12 2020-06-09 00:27:05

Knewlogik
Member
Registered: 2020-05-11
Posts: 18

### Re: All primes formula

2520/P= P is prime are you could use any number you would like the only rule is you have to come up with a mixed number and the mixed number must be the same number as the number you are trying to see is prime so if I was to put 11 where the p is then the mixed number should have a denominator of 11 then I would know what to prime

Offline

## #13 2020-06-09 00:33:12

Knewlogik
Member
Registered: 2020-05-11
Posts: 18

### Re: All primes formula

2520 will do primes of three digits and below if you want to go any higher you just keep adding a zero to my magic number you want to divide any number into my magic number if you come up with the mixed number and it has a denominator that is the same as the number you divided by then you know it's prime l

Offline

## #14 2020-06-09 03:11:43

Knewlogik
Member
Registered: 2020-05-11
Posts: 18

### Re: All primes formula

Knewlogik wrote:

Well I've been crunching numbers and I figured out a way to pull the pr do I have an answer for the primes problem now all you have to do is take the number 2520 and divided by any number that is two digit add another zero if you want to do three digits add another zero if you want to do for digits add another zero if you want to do 5 digits and if the denominator of the mixed fraction is the same as the number you divided into my special number then it is a prime bottom line I've tried every prime so far has worked  example 25200/101=.             249 51/101.  just ignore the rest of the number and noticed the denominator is 101 so therefore it must be prime and only then is it prime

Prayer changes things and gives results

Offline

## #15 2020-06-09 05:34:02

Bob
Administrator
Registered: 2010-06-20
Posts: 8,909

### Re: All primes formula

Sorry. It's still not making any sense to me.  I had hoped for some examples of this in action.  Tell you what: how about I set some examples and you show how your method works for those:#

Test numbers:

(1) 73

(2) 77

(3)  91

(4)  143

Thanks,

Bob

Children are not defined by school ...........The Fonz
You cannot teach a man anything;  you can only help him find it within himself..........Galileo Galilei
Sometimes I deliberately make mistakes, just to test you!  …………….Bob

Offline

## #16 2020-06-09 15:36:53

Knewlogik
Member
Registered: 2020-05-11
Posts: 18

### Re: All primes formula

25200/73=345+15/73 73 is the denominator so 73 is prime
2520/77=327+3/11 11 is denominator so this is not prime since it's not 77
25200/91=276+12/13 13 is  not 91 so it's not prime
25200/143=176+32/143 143 is the denominator  so yes this is primesee

Offline

## #17 2020-06-09 19:30:02

Bob
Administrator
Registered: 2010-06-20
Posts: 8,909

### Re: All primes formula

143 = 13 * 11

B

Children are not defined by school ...........The Fonz
You cannot teach a man anything;  you can only help him find it within himself..........Galileo Galilei
Sometimes I deliberately make mistakes, just to test you!  …………….Bob

Offline

## #18 2020-06-09 20:32:49

Knewlogik
Member
Registered: 2020-05-11
Posts: 18

### Re: All primes formula

My number work for 2 digit 3 digit use 232792560

Offline

## #19 2020-06-09 20:33:56

Knewlogik
Member
Registered: 2020-05-11
Posts: 18

### Re: All primes formula

How would you write that into something I can run on a computer

Offline

## #20 2020-06-09 23:23:08

Bob
Administrator
Registered: 2010-06-20
Posts: 8,909

### Re: All primes formula

You need  to state exactly what the procedure is.  Sometimes a flow diagram is helpful.

You need steps like

"Let N represent the number under test.

" Let D represent the dividend"

"Set D = 25200"

Calculate D/N.

Say what to do if (a) the answer is an integer; (b) how to extract the 'remainder' as a fraction.

"Test if the fraction is in its lowest terms."

The above is not a complete algorithm.  I'm not sure exactly what steps you want to take for this to be successful.  You need a very clear set of steps.  If I cannot understand them, how will your computer program 'know' what to do at each step?

Bob

Children are not defined by school ...........The Fonz
You cannot teach a man anything;  you can only help him find it within himself..........Galileo Galilei
Sometimes I deliberately make mistakes, just to test you!  …………….Bob

Offline

## #21 2020-06-10 16:22:40

Knewlogik
Member
Registered: 2020-05-11
Posts: 18

### Re: All primes formula

sorry white 143 is not a prime I'll question for I should have switched to the three-digit number I was still using two two digit number on my calculator so sorry about that 232792560/143=1627920 so no prime

Offline

## #22 2020-06-10 16:27:51

Knewlogik
Member
Registered: 2020-05-11
Posts: 18

### Re: All primes formula

You don't have to check to see if it's in lowest terms that's the point of the number the d answer or denominator whatever will be the same as the number that you're dividing into the set d1=2520, d2=92378* D1

Offline

## #23 2020-07-06 12:19:11

Knewlogik
Member
Registered: 2020-05-11
Posts: 18

### Re: All primes formula

So I've been on this prime thing this whole time and I was just in spreadsheet I figured out a way to get every prime but it takes a little bit of work cuz I don't know how to write the formulas but if you were to for example I'm sure you're familiar with Excel start with the first line skip it and go to the second line which would be a2 you leave that square blank and then B2 you put the number two i C2 you leave blank D2 you put the number two can you repeat this all the way down forever infinity then you go down to the the list draw the numbers meaning the third line will have two blanks and then the number three to blanks number 3/4 vinyl have three blanks number for three blanks number for when you do this can you do it all the way through you'll be left with empty columns with the number at the bottom of it and the number at the bottom is always going to be a prime and it's only going to be a prime

Offline

## #24 2020-07-06 14:26:58

pi_cubed
Member
From: A rhombicosidodecahedron
Registered: 2020-06-22
Posts: 63

### Re: All primes formula

Knewlogik wrote:

Well I've been crunching numbers and I figured out a way to pull the pr do I have an answer for the primes problem now all you have to do is take the number 2520 and divided by any number that is two digit add another zero if you want to do three digits add another zero if you want to do for digits add another zero if you want to do 5 digits and if the denominator of the mixed fraction is the same as the number you divided into my special number then it is a prime bottom line I've tried every prime so far has worked  example 25200/101=.             249 51/101.  just ignore the rest of the number and noticed the denominator is 101 so therefore it must be prime and only then is it prime

This is an extremely confusing process. Please explain it more clearly.

e to the i pi plus 1 is zero -Leonhard Euler | a squared plus b squared equals c squared -Pythagoras | Energy equals mass times the speed of light squared -Albert Einstein | i² = -1 | x^2+1=0 x^2=-1 x=i

Offline

## #25 2020-07-08 15:41:00

Mathegocart
Member
Registered: 2012-04-29
Posts: 2,073

### Re: All primes formula

With all due respect, can Knewlogik stop referring to irrelevant prayers?(I have no disrespect for religion - I am a Christian myself, but it is not necessary here.) Also, please learn how to use punctuation(commas, semicolons, you know... periods.)

Are you ESL?

The integral of hope is reality.
May bobbym have a wonderful time in the pearly gates of heaven.
He will be sorely missed.

Offline

## Board footer

Powered by FluxBB