A prime generator I discovered

  • #1
3,077
3

Main Question or Discussion Point

Somewhere between brute force and Mersenne derivation of primes is the formula I found,

[tex]\prod_{n=1}^Np_n-1=p_Z[/tex]

I guess it would generate more primes pZ than Mersenne in a given interval, but requires knowledge of all primes to pN, the Nth prime. It may produce only primes, rather than Mersenne's hit-or-miss search. The pn here are supposed to follow 2, 3, 5, 7, 11, 13, 17...pN, but the formula might work somewhat with an incomplete sequence of primes.

Have I discovered anything new here? The equation is so simple and effective that it must have already been found.
 

Answers and Replies

  • #2
841
0
Somewhere between brute force and Mersenne derivation of primes is the formula I found,

[tex]\prod_{n=1}^Np_n-1=p_Z[/tex]

I guess it would generate more primes pZ than Mersenne in a given interval, but requires knowledge of all primes to pN, the Nth prime. It may produce only primes, rather than Mersenne's hit-or-miss search. The pn here are supposed to follow 2, 3, 5, 7, 11, 13, 17...pN, but the formula might work somewhat with an incomplete sequence of primes.

Have I discovered anything new here? The equation is so simple and effective that it must have already been found.
The above formula has been used to prove that there are an infinite number of primes and is well known. Unfortunately I believe the larger n is the less chance that the number is prime even though it is clear that all primes up through the Nth prime do not divide this number.
 
  • #3
Borek
Mentor
28,326
2,713
2*3*5*7*11*17-1 = 107*367

(you are not the first one with this idea :wink:)
 
  • #4
CRGreathouse
Science Advisor
Homework Helper
2,820
0
See http://www.research.att.com/~njas/sequences/A005265 [Broken] and related sequences.
 
Last edited by a moderator:

Related Threads for: A prime generator I discovered

Replies
11
Views
4K
Replies
14
Views
5K
  • Last Post
Replies
12
Views
4K
  • Last Post
Replies
5
Views
4K
  • Last Post
Replies
2
Views
2K
Replies
8
Views
3K
  • Last Post
Replies
21
Views
7K
Replies
3
Views
3K
Top