Chatroom
 

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Bad Astronomy and Universe Today Forum > General > Off-Topic Babbling
Register FAQ Members List Calendar Mark Forums Read

   

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 24-November-2007, 09:09 PM
grav grav is offline
Senior Member
 
Join Date: May 2006
Posts: 2,558
Default Prime numbers and double primes

I was reading through this thread (just started it, though) and it got me thinking about the randomness of primes. I figure there must be some form of pattern for them, even if we can't directly see it. The way I figure, if we start with all integers and subtract those that aren't primes, then we would be left with numbers that fall into the sets of

2n +/- 1
3n +/- 1 , 3n +/- 2
4n +/- 1 , 4n +/- 2 , 4n +/- 3
etc

which basically just rids us of all forms of 2n, 3n, 4n, etc, so that all of the primes that are left should be equal to a number in each of the sets above, up to the value of the integer we are finding for. Well, anyway, I started working through that and realized that the set 6n +/- 1 is the only one that can be used for the set for 6, since 6n +/- 2 and 6n +/- 4 will each give a number divisible by 2, and 6n +/- 3 will give a number divisible by 3, and 6n +/- 5 is the same as 6n +/- 1 for a higher or lower value of n (both of which are also true for the set for 4 above).

Since all primes must match a number in every set, then this means that all primes greater than 3 must be of the form 6n +/- 1. All double primes, then, which are separated from each other by two, must be of the form 6n - 1, 6n + 1. Is this known? I've looked around some but haven't found it. I'm sure it is but I'll ask anyway. I've just started working on this but I'm wondering what else might be determined by such sets. Any suggestions?
__________________
Let's put together the pieces of The Grand Puzzle . (website)

"Let's define another operator, Sz, which we won't pay any attention to."
"This transformation will automatically make zero equal zero."
"It may be true that zero equals zero -- and that is certainly an equality -- but I don't want to go into the details at this time."
Reply With Quote
  #2 (permalink)  
Old 24-November-2007, 11:10 PM
mugaliens's Avatar
mugaliens mugaliens is offline
Senior Member
 
Join Date: Dec 2005
Location: Germany
Posts: 8,586
Default

Primes have passed every test for randomness, which is why they've been at the core of encryption technology for many years.

However, because primes are reproducible on both sides, they've since been abandonded as keys, regardless of combination, as the assumed use of primes seriously reduces the keyspace of whatever encoding technology is used.

Since the heyday of primes, we've developed unbreakable encryption. Doesn't matter the power of the computer, or how many billions of years you hack away at it. By it's very nature, it can't be done.

And that's the way we do business today.
__________________
I am Mugs, of the Alien clan of Usa, Nordamerica, a Terran, of Sol.

"A positive attitude may not solve all your problems, but it will annoy enough people to make it worth the effort." - Herm Albright
Reply With Quote
  #3 (permalink)  
Old 24-November-2007, 11:59 PM
01101001's Avatar
01101001 01101001 is offline
Senior Member
 
Join Date: Mar 2004
Posts: 11,626
Default

Quote:
Originally Posted by grav View Post
Since all primes must match a number in every set, then this means that all primes greater than 3 must be of the form 6n +/- 1.
Prime FAQ:

Quote:
Perhaps the most rediscovered result about primes numbers is the following:
I found that every prime number over 3 lies next to a number divisible by six.
(If there's no space or astronomy connection forthcoming, may I ask for this be moved out of the space-and-astronomy Q&A forum?)
__________________
0 1 1 0 1 0 0 1 1 0 0 1 0 1 1 0 1 0 0 1 0 1 1 0 0 1 1 0 1 0 0 1 1 0 0 1 0 1 1 0 0 1 1 0 1 0 0 1 0 1 1 0 1 0 0 1 1 0 0 1 0 1 1 0 ...
Reply With Quote
  #4 (permalink)  
Old 25-November-2007, 12:32 AM
a1call's Avatar
a1call a1call is offline
Senior Member
 
Join Date: Jun 2005
Posts: 525
Default

Yes,
generally any prime number greater than any primorial is of the form (n*that-primorial) + or - 1.
where n is some integer greater than 0.

This has been known since antiquity.

If I'm not mistaking it is also proven that the set of primes of the form n!-1 is infinite which is probably why the distributed computer programs which search for the biggest known prime number utilize`primes of the form.

added: Just remembered it's more complicated than that:
generally any prime number greater than any primorial is of the form (n*that-primorial) + q +/-1.
where n is some integer greater than 0 and q is a primorial or 0 and q<(that-primorial).

Or Something like that. I do remember something.
__________________
"They reasoned that an object situated at the center and related equally to the extremes in every direction can have no impulse to move in any specific direction. In fact, they compared the situation of such an object with that of a man violently but equally hungry and thirsty, standing at the same distance from food and drink and unable to decide in which direction to move." - Aristotle

Last edited by a1call; 25-November-2007 at 03:08 AM.
Reply With Quote
  #5 (permalink)  
Old 25-November-2007, 01:16 AM
grav grav is offline
Senior Member
 
Join Date: May 2006
Posts: 2,558
Default

Oh, okay. Thanks everybody. I just thought it was interesting. I'll still keep going through it for a while, though.
__________________
Let's put together the pieces of The Grand Puzzle . (website)

"Let's define another operator, Sz, which we won't pay any attention to."
"This transformation will automatically make zero equal zero."
"It may be true that zero equals zero -- and that is certainly an equality -- but I don't want to go into the details at this time."
Reply With Quote
  #6 (permalink)  
Old 25-November-2007, 01:30 AM
a1call's Avatar
a1call a1call is offline
Senior Member
 
Join Date: Jun 2005
Posts: 525
Default

Quote:
Originally Posted by grav View Post
Oh, okay. Thanks everybody. I just thought it was interesting. I'll still keep going through it for a while, though.
I think I have mentioned before how similar our brains are wired. I think I have spent about 3 or 4 years in of my life in the same line of thinking. I know exactly where you are going so let me save you some time. The method can be used to program a computer to generate prime numbers pn for any given n. But the catch is that the series calculations can not be mathematically reduced and ends up consuming more computer cycles and time than if you would check for divisibility one by one.
basically the prfoblem boils down to the fact that

int(a/b) can not be solved by basic mathematical operators. In other words int(2.45)=2 can not be represented using mathematical operators -,+, ....


I am sure you understand.
__________________
"They reasoned that an object situated at the center and related equally to the extremes in every direction can have no impulse to move in any specific direction. In fact, they compared the situation of such an object with that of a man violently but equally hungry and thirsty, standing at the same distance from food and drink and unable to decide in which direction to move." - Aristotle
Reply With Quote
  #7 (permalink)  
Old 25-November-2007, 03:20 AM
grav grav is offline
Senior Member
 
Join Date: May 2006
Posts: 2,558
Default

Well, I know what you mean about int(a/b), but as for the rest, maybe I just haven't gotten that far yet.
__________________
Let's put together the pieces of The Grand Puzzle . (website)

"Let's define another operator, Sz, which we won't pay any attention to."
"This transformation will automatically make zero equal zero."
"It may be true that zero equals zero -- and that is certainly an equality -- but I don't want to go into the details at this time."
Reply With Quote
  #8 (permalink)  
Old 27-November-2007, 05:08 AM
grav grav is offline
Senior Member
 
Join Date: May 2006
Posts: 2,558
Default

Well, looks like I may be getting a little closer to an algorithm that can generate all primes and only primes, although I've still got quite a way to go. I have noticed that 6n +/- 1 will generate all primes and composites of two primes, but no composites containing three or more, and that is a very good start. But instead of 6n +/- 1, we can use 6n+1 and 6n+5, starting at n=0, which will give us all of the primes except for 2 and 3, the two multiples for the base number of 6n. The composites of two primes will contain a multiple of any two primes except for multiples of 2 and 3.

To limit this even further, then, instead of 6n, we can use an algorithm with a base number that contains more than two primes, such as 2*3*5=30. Then the list will be that of all primes and composites of any two primes except for those with multiples of 2, 3, and 5. We then add any number to 30n that does not have a common multiple with our base number, which for 30n, would be every prime up to 30 except for 2, 3, and 5. Below is an example for that algorithm, giving every prime (greater than 5) and composite of two primes (except for multiples of 2, 3, and 5) up to 1000. The solitary primes far out way the composites of two primes. There are 100 composites out of 266 in all, but the graph is still 62.4% pure primes, providing the first 166 prime numbers.

Code:
30n    

n       +1   +7  +11  +13  +17  +19  +23  +29  

0        1    7   11   13   17   19   23   29
1       31   37   41   43   47   49   53   59
2       61   67   71   73   77   79   83   89
3       91   97  101  103  107  109  113  119
4      121  127  131  133  137  139  143  149
5      151  157  161  163  167  169  173  179
6      181  187  191  193  197  199  203  209
7      211  217  221  223  227  229  233  239
8      241  247  251  253  257  259  263  269
9      271  277  281  283  287  289  293  299
10     301  307  311  313  317  319  323  329
11     331  337  341  343  347  349  353  359
12     361  367  371  373  377  379  383  389
13     391  397  401  403  407  409  413  419
14     421  427  431  433  437  439  443  449
15     421  427  431  433  437  439  443  449
16     451  457  461  463  467  469  473  479
17     481  487  491  493  497  499  503  509
18     511  517  521  523  527  529  533  539
19     541  547  551  553  557  559  563  569
20     571  577  581  583  587  589  593  599
21     601  607  611  613  617  619  623  629
22     631  637  641  643  647  649  653  659
23     661  667  671  673  677  679  683  689
24     691  697  701  703  707  709  713  719
25     721  727  731  733  737  739  743  749
26     751  757  761  763  767  769  773  779
27     781  787  791  793  797  799  803  809
28     811  817  821  823  827  829  833  839
29     841  847  851  853  857  859  863  869
30     871  877  881  883  887  889  893  899
31     901  907  911  913  917  919  923  929
32     931  937  941  943  947  949  953  959
33     961  967  971  973  977  979  983  989
34     991  997
__________________
Let's put together the pieces of The Grand Puzzle . (website)

"Let's define another operator, Sz, which we won't pay any attention to."
"This transformation will automatically make zero equal zero."
"It may be true that zero equals zero -- and that is certainly an equality -- but I don't want to go into the details at this time."
Reply With Quote
  #9 (permalink)  
Old 27-November-2007, 05:19 AM
01101001's Avatar
01101001 01101001 is offline
Senior Member
 
Join Date: Mar 2004
Posts: 11,626
Default

What's the space or astronomy connection?
__________________
0 1 1 0 1 0 0 1 1 0 0 1 0 1 1 0 1 0 0 1 0 1 1 0 0 1 1 0 1 0 0 1 1 0 0 1 0 1 1 0 0 1 1 0 1 0 0 1 0 1 1 0 1 0 0 1 1 0 0 1 0 1 1 0 ...
Reply With Quote
  #10 (permalink)  
Old 27-November-2007, 05:43 AM
grav grav is offline
Senior Member
 
Join Date: May 2006
Posts: 2,558
Default

Quote:
Originally Posted by 01101001 View Post
What's the space or astronomy connection?
There might turn out to be one, who knows? There already is in technology, as mugaliens pointed out. It also has some applicability to the concept of random, as in the other thread I linked to, which is where it originally caught my interest. And that has some applicability to quantum mechanics and chaos theory and such. "God does not play dice with the universe", you know, that sort of thing. But I'll have to figure all that out when I'm done with this much of it.

Whether or not there will turn out to be some direct application for this particular endeavor, I'm not sure, but all of mathematics can be applicable in some aspect or other, I believe, and it caught my interest and I wasn't sure where else to put it. This part of the forum is labeled "general> questions and answers", but it looks like I'll probably just be working through it at this point the best I can. Any input would be helpful. If this needs to be moved, then that is fine too. Maybe 'general science' would have been better?
__________________
Let's put together the pieces of The Grand Puzzle . (website)

"Let's define another operator, Sz, which we won't pay any attention to."
"This transformation will automatically make zero equal zero."
"It may be true that zero equals zero -- and that is certainly an equality -- but I don't want to go into the details at this time."

Last edited by grav; 27-November-2007 at 06:18 AM.
Reply With Quote
  #11 (permalink)  
Old 27-November-2007, 04:09 PM
Ivan Viehoff Ivan Viehoff is online now
Senior Member
 
Join Date: Apr 2004
Location: Chalfont St. Giles, England
Posts: 510
Default

Quote:
Originally Posted by grav View Post
this means that all primes greater than 3 must be of the form 6n +/- 1.
It is precisely the same as saying all primes > 3 can't be divisible by 2 or 3.
Reply With Quote
  #12 (permalink)  
Old 27-November-2007, 04:35 PM
HenrikOlsen's Avatar
HenrikOlsen HenrikOlsen is online now
Moderator
 
Join Date: Sep 2003
Location: Denmark 55.6773° N 12.3610° E
Posts: 5,674
Default

Quote:
Originally Posted by a1call View Post
If I'm not mistaking it is also proven that the set of primes of the form n!-1 is infinite which is probably why the distributed computer programs which search for the biggest known prime number utilize`primes of the form.
Actually the search for the largest known primes look at numbers of the form 2n-1.
The reason is that numbers of that special form has the fastest known primality test, which means a lot when you're looking at numbers where a normal pc can test one number in 3 months working all out.

Currently largest is 232,582,657-1, with 9,808,358 digits.
__________________
It would be hard to imagine an uglier building that hadn't won a major architectural award.
Pratchett, Making Money
Trying to make sense of computers, The Error Log.
Reply With Quote
  #13 (permalink)  
Old 27-November-2007, 04:37 PM
Ivan Viehoff Ivan Viehoff is online now
Senior Member
 
Join Date: Apr 2004
Location: Chalfont St. Giles, England
Posts: 510
Default

Quote:
Originally Posted by grav View Post
Well, looks like I may be getting a little closer to an algorithm that can generate all primes and only primes, although I've still got quite a way to go. I have noticed that 6n +/- 1 will generate all primes and composites of two primes, but no composites containing three or more, and that is a very good start.
The Sieve of Eratosthenes http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes is an algorithm that generates all primes and only primes. Are you trying to rediscover it only 2,200 years late, or do you have something more ambitious in mind?

5 x 7 x 11 = 385 = 6 x 64 + 1
So your assertion that 6n +/- 1 excludes triple prime composites fails at the first place it could fail.

Just because there is an algorithm, doesn't mean there is pattern. Chaos is generated by very simple formulas. In searching for a pattern in the primes, you are attempting what has occupied most of the finest mathematical brains for centuries. Indeed they have proven that there isn't a pattern in the normally accepted sense, as was said below. The Riemann Hypothesis is in effect the same subject. Read (at least) section 2 of this: http://en.wikipedia.org/wiki/Riemann_hypothesis You can win a lot of money by solving the Riemann Hypothesis.

Last edited by Ivan Viehoff; 27-November-2007 at 04:40 PM. Reason: The thread was moved to a more appropriate category.
Reply With Quote
  #14 (permalink)  
Old 27-November-2007, 06:04 PM
John Mendenhall John Mendenhall is offline
Senior Member
 
Join Date: Jun 2006
Location: New Castle DE
Posts: 1,704
Default Nice View From Up Here

At a little less difficult level, see if you can find a copy of George Gamow's book, "1,2,3 . . . Infinity", which among other things has a wonderful section on primes. And the advice of several previous posters is correct, put your effort where it will do the most good. Primes are like general and special relativity, but much much older; many many very bright people have explored the fundamentals already. Use the accumulated knowledge base. Stand on their shoulders and see what you can see.
Reply With Quote
  #15 (permalink)  
Old 27-November-2007, 08:58 PM
peteshimmon peteshimmon is offline
Senior Member
 
Join Date: Jul 2003
Location: uk
Posts: 1,760
Default

I saw something in Scientific American many
years ago that gave me to understand primes
had been cracked! But it turned out just a
curiousity, the Ulam spiral. Tried my own
version from a corner and found an endless
line of non-primes. Odd square followed by
even number. Trivial presumably. There is
plenty on Google about primes including many
ways of picturing them. Here is a project,
a histogram of the divisors from consecutive
primes. I developed a special log base for the
counting, nine columns between each power of
ten. If you understand what I am describing!
Reply With Quote
  #16 (permalink)  
Old 27-November-2007, 09:55 PM
jfribrg jfribrg is offline
Senior Member
 
Join Date: Mar 2002
Location: 40N 75W mag 4.1 sky at best
Posts: 1,261
Default

I've had a strong interest in primes since I was in high school. If you're looking for a pattern, then your best bet is to study the Riemann hypothesis. IIRC, there is a million dollar prize for the first person who can prove it true. I'm not sure if you get anything if you prove it false. Don't get your hopes up too fast though. As was mentioned before, some of the best mathematical minds have tried to prove it. These geniuses have made progress, but a definitive proof is still missing. Just understanding the Riemann hypothesis requires a good amount of college level complex analysis.

Over the years, I have accumulated a library of books about the subject, some good, some bad. Here is an abriged and annotated list (CYA disclaimer: I have no financial connection to any of these authors or publishers):

Prime numbers and Computer Methods of Factorization IMO this is the best book on the subject that is accesible to someone with an undergraduate math background.

Prime numbers; A computational Perspective Another good book that assumes an undergraduate math background written by one of the heavyweights in the field.

Excursions in Number Theory This is the book that got me hooked on prime numbers 25 years ago. Written in the 1960's, it is very dated but accessible to anyone who remembers Algebra from high school.

Factorization and Primality Testing. Well written book especially if you want to write any computer programs relating to prime numbers. This assumes a college level math aptitude.

There are also several "layman's" books on the history of the Riemann Hypothesis. From a historical perspective, they may be interesting, but don't expect to learn any math from them.
__________________
True is the question
Derived from the Shakespeare Postulate (2b)|| !(2b)
Reply With Quote
  #17 (permalink)  
Old 28-November-2007, 03:27 AM
grav grav is offline
Senior Member
 
Join Date: May 2006
Posts: 2,558
Default

Quote:
Originally Posted by Ivan Viehoff View Post
The Sieve of Eratosthenes http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes is an algorithm that generates all primes and only primes. Are you trying to rediscover it only 2,200 years late, or do you have something more ambitious in mind?

5 x 7 x 11 = 385 = 6 x 64 + 1
So your assertion that 6n +/- 1 excludes triple prime composites fails at the first place it could fail.

Just because there is an algorithm, doesn't mean there is pattern. Chaos is generated by very simple formulas. In searching for a pattern in the primes, you are attempting what has occupied most of the finest mathematical brains for centuries. Indeed they have proven that there isn't a pattern in the normally accepted sense, as was said below. The Riemann Hypothesis is in effect the same subject. Read (at least) section 2 of this: http://en.wikipedia.org/wiki/Riemann_hypothesis You can win a lot of money by solving the Riemann Hypothesis.
Thanks Ivan. Of course you're right about that triple prime composites thing. I realized it last night but hadn't had a chance to correct myself yet. I should have thought about that triple prime composites for larger numbers, though, since it's really just what you stated about the 6n +/-1 thing, it only excludes multiples of 2 and 3, so any combination of primes that are greater than those will eventually be combined. So this just begins with double composites at the square of the next higher prime, and triple composites at the cube of the same prime. For that 30n graph I made above, then, the double composites would start at 7^2 = 49 and the triple composites at 7^3 = 343. Obviously, continuing in this fashion, quadruple composites would begin at 7^4 = 2401, and so on. I'm still trying to find a way to work through this by building up from lower to higher sets, 2n, then 6n, 30n, 210n, etc.
__________________
Let's put together the pieces of The Grand Puzzle . (website)

"Let's define another operator, Sz, which we won't pay any attention to."
"This transformation will automatically make zero equal zero."
"It may be true that zero equals zero -- and that is certainly an equality -- but I don't want to go into the details at this time."
Reply With Quote
  #18 (permalink)  
Old 28-November-2007, 07:49 AM
The_Radiation_Specialist's Avatar
The_Radiation_Specialist The_Radiation_Specialist is offline
Senior Member
 
Join Date: Dec 2005
Posts: 1,556
Send a message via Yahoo to The_Radiation_Specialist
Default

Ahh, prime numbers, I too have had a strong interest in them since I was in high school (and I just got out of high school).

I think there is proof which says by definition prime numbers can't have a polynomial function which can predict all prime numbers. There are some curious ones like n^2 + n + 41, discovered by Euler which generates prime for all non-negative integers less than 40. There are many other curious functions like that on all levels and this is an area of interest to see how these functions are related and how to generate them.

The ulam spiral is fascinating too. All prime numbers except 2 are odd numbers. Since in the Ulam spiral adjacent diagonals are alternatively odd and even numbers, it is no surprise that all prime numbers lie in alternate diagonals of the Ulam spiral. What is startling is the tendency of prime numbers to lie on some diagonals more than others. In effect I would have expected to see something like the "snow" on old TVs, but there are more patterns.

About the 6n +/- 1 pattern It can be proven that in all possible values of a number mod 6

0 1 2 3 4 5
taking out numbers divisible by 2 or 3 (the prime numbers) you are left with,

X 1 X X X 5

which are incidentally numbers of form 6n +/-1. Now this property is only because we are starting with the two smallest prime numbers and we "know" them. This shows all primes should be of this format. But not all numbers of this format are primes, obviously.

We could even go on further with 2*3*5 = 30.