mersenneforum.org  

Go Back   mersenneforum.org > Great Internet Mersenne Prime Search > Software

Reply
 
Thread Tools
Old 2009-06-06, 06:35   #23
robert44444uk
 
robert44444uk's Avatar
 
Jun 2003
Suva, Fiji

7FA16 Posts
Default

Quote:
Originally Posted by geoff View Post
Robert, I have uploaded a sieve here. See the README for instructions.
Geoff, sieve works well!
robert44444uk is offline   Reply With Quote
Old 2009-06-08, 13:32   #24
R.D. Silverman
 
R.D. Silverman's Avatar
 
"Bob Silverman"
Nov 2003
North of Boston

166158 Posts
Default

Quote:
Originally Posted by R.D. Silverman View Post
I told you that some time ago. Such primes will be rare.

A more interesting question is whether there exists values of a for
which there are no primes. If so, what is the density of that set?


Here is the argument.

Let
<br />
 f(a,b) = a^{2^n}  + (a+1)^{2^n}.<br />

The "probability" that f(a,b) is prime is
 1/\log(f(a,b)) <br />
by the PNT.


The "probability" that for fixed a, f(a, b) is not prime is
 <br />
(1 - \frac{1}{2^b log a}). <br />

(approximately) Replacing a by (a+1) just above would be slightly more accurate.

The probability that f(a, b) is NOT prime for ALL b is
<br />
y = \prod_{b=1}^{\infty} (1 - \frac{1}{2^b \log a)})

(approximately)

Take the log of both sides and expand
 \log(1 - \frac{1}{2^b \log a})
using Taylor series. One gets

<br />
<br />
\log y = - \sum_{b=1}^{\infty} (  1/(2^b \log a) + 1/(2* 2^{2b} \log^2(a)) + ...)  <br />

Summing over b yields
<br />
\log y = -( 1/(\log a) +  1/(3* 2 \log^2(a)) + 1/(7 * 3 \log^3(a)) + ....)<br />

This is a very rapidly decreasing series. If we just take the first term
we get   y = exp(-1/\log(a))

Note that taking more terms just reduces the probability. We could
be a little more careful here and use Taylor series with remainder, but it
is not needed. Note that for any a

  y = exp(-1/\log(a))

goes to one fairly quickly as a gets large.

The "expected" number of a for which there should be a prime is
then given by the following Stieltje's integral.

<br />
\int_{x=2}^{\infty}  exp(-1/\log(x))  d[x]<br />
<br />
<br />

This integral is definitely bounded away from 0. One could replace
log(x) with log(x+1) for a little bit more accuracy.

This will give a rough approximation to the density of the set a for
which a prime does exist. I was a bit surprised by this result; My
a priori expectation was that the asymptotic density would be zero.


Getting even a couple of sig.figs. for this estimate would be quite
difficult, since the above analysis used a number of approximations.

Comments please.
R.D. Silverman is offline   Reply With Quote
Old 2009-06-08, 13:36   #25
R.D. Silverman
 
R.D. Silverman's Avatar
 
"Bob Silverman"
Nov 2003
North of Boston

5·17·89 Posts
Default

Quote:
Originally Posted by R.D. Silverman View Post
Here is the argument.

Let
<br />
 f(a,b) = a^{2^n}  + (a+1)^{2^n}.<br />

The "probability" that f(a,b) is prime is
 1/\log(f(a,b)) <br />
by the PNT.


The "probability" that for fixed a, f(a, b) is not prime is
 <br />
(1 - \frac{1}{2^b log a}). <br />

(approximately) Replacing a by (a+1) just above would be slightly more accurate.

The probability that f(a, b) is NOT prime for ALL b is
<br />
y = \prod_{b=1}^{\infty} (1 - \frac{1}{2^b \log a)})

(approximately)

Take the log of both sides and expand
 \log(1 - \frac{1}{2^b \log a})
using Taylor series. One gets

<br />
<br />
\log y = - \sum_{b=1}^{\infty} (  1/(2^b \log a) + 1/(2* 2^{2b} \log^2(a)) + ...)  <br />

Summing over b yields
<br />
\log y = -( 1/(\log a) +  1/(3* 2 \log^2(a)) + 1/(7 * 3 \log^3(a)) + ....)<br />

This is a very rapidly decreasing series. If we just take the first term
we get   y = exp(-1/\log(a))

Note that taking more terms just reduces the probability. We could
be a little more careful here and use Taylor series with remainder, but it
is not needed. Note that for any a

  y = exp(-1/\log(a))

goes to one fairly quickly as a gets large.

The "expected" number of a for which there should be a prime is
then given by the following Stieltje's integral.

<br />
\int_{x=2}^{\infty}  exp(-1/\log(x))  d[x]<br />
<br />
<br />

This integral is definitely bounded away from 0. One could replace
log(x) with log(x+1) for a little bit more accuracy.

This will give a rough approximation to the density of the set a for
which a prime does exist. I was a bit surprised by this result; My
a priori expectation was that the asymptotic density would be zero.


Getting even a couple of sig.figs. for this estimate would be quite
difficult, since the above analysis used a number of approximations.

Comments please.
Note that one thing that can be done to improve the approximations
is to observe that f(a,b) is always odd. This immediately improves the
probability of its being prime by a factor of 2.
R.D. Silverman is offline   Reply With Quote
Old 2009-06-08, 20:30   #26
R.D. Silverman
 
R.D. Silverman's Avatar
 
"Bob Silverman"
Nov 2003
North of Boston

756510 Posts
Default

Quote:
Originally Posted by R.D. Silverman View Post
Note that one thing that can be done to improve the approximations
is to observe that f(a,b) is always odd. This immediately improves the
probability of its being prime by a factor of 2.
Discussion? Any ideas on how to get an effectively computable answer?

For those of you doing these computations, it might be nice to tally
those a less than (say) 1000 for which no prime could be found for b up to
(say) 12 or 13.
R.D. Silverman is offline   Reply With Quote
Old 2009-06-08, 20:49   #27
Primeinator
 
Primeinator's Avatar
 
"Kyle"
Feb 2005
Somewhere near M52..

2×33×17 Posts
Default

Well... I decided to post since no one else replied. I followed pretty much most of the math but the reasoning is beyond me as I do not have enough mathematical background. In my spare time I am reading a book on Advanced Calculus. I also want to find some good books on number theory. I do have one question though on your last integral. Does the integral of e^(-1/log x) even have a closed form solution or does it have to be evaluated numerically?
Primeinator is offline   Reply With Quote
Old 2009-06-08, 21:57   #28
R.D. Silverman
 
R.D. Silverman's Avatar
 
"Bob Silverman"
Nov 2003
North of Boston

11101100011012 Posts
Default

Quote:
Originally Posted by Primeinator View Post
Well... I decided to post since no one else replied. I followed pretty much most of the math but the reasoning is beyond me as I do not have enough mathematical background. In my spare time I am reading a book on Advanced Calculus. I also want to find some good books on number theory. I do have one question though on your last integral. Does the integral of e^(-1/log x) even have a closed form solution or does it have to be evaluated numerically?

It is not an elementary function.

The derivation that I gave does not require "advanced" Calculus.
It does require knowledge of the Prime Number Theorem, elementary
probability theory, and 1st yr calculus with Taylor series.
R.D. Silverman is offline   Reply With Quote
Old 2009-06-08, 23:07   #29
Primeinator
 
Primeinator's Avatar
 
"Kyle"
Feb 2005
Somewhere near M52..

2×33×17 Posts
Default

Very well. Since you are about the most knowledgeable person on this forum, mathematically speaking, what books would you recommend I read to learn about number theory/prime number theory and the books required to build up to those? I have had all three levels of basic Calculus and I have also taken ordinary differential equations. I do not have time for "a lot" of reading, but math is something of a hobby of mine when I have the spare time. Because prime numbers are something I am so interested in, I am willing to take as long as is needed to learn the curriculum. Thanks.
Primeinator is offline   Reply With Quote
Old 2009-06-08, 23:23   #30
R.D. Silverman
 
R.D. Silverman's Avatar
 
"Bob Silverman"
Nov 2003
North of Boston

11101100011012 Posts
Default

Quote:
Originally Posted by Primeinator View Post
Very well. Since you are about the most knowledgeable person on this forum, mathematically speaking, what books would you recommend I read to learn about number theory/prime number theory and the books required to build up to those? I have had all three levels of basic Calculus and I have also taken ordinary differential equations. I do not have time for "a lot" of reading, but math is something of a hobby of mine when I have the spare time. Because prime numbers are something I am so interested in, I am willing to take as long as is needed to learn the curriculum. Thanks.

Hardy & Wright. Intro to Number Theory
D. Shanks Solved & Unsolved Problems in No. Theory

will do for starters.
R.D. Silverman is offline   Reply With Quote
Old 2009-06-08, 23:45   #31
Primeinator
 
Primeinator's Avatar
 
"Kyle"
Feb 2005
Somewhere near M52..

2×33×17 Posts
Default

Thanks!
Primeinator is offline   Reply With Quote
Old 2009-06-08, 23:57   #32
ATH
Einyen
 
ATH's Avatar
 
Dec 2003
Denmark

22×863 Posts
Default

Quote:
Originally Posted by geoff View Post
Robert, I have uploaded a sieve here. See the README for instructions.
Be careful when sieving for small b and large k, if the factor is actually equal to the number, that number is removed as well even if possible prime.
ATH is offline   Reply With Quote
Old 2009-06-09, 10:30   #33
robert44444uk
 
robert44444uk's Avatar
 
Jun 2003
Suva, Fiji

2×1,021 Posts
Default

Quote:
Originally Posted by R.D. Silverman View Post
Discussion? Any ideas on how to get an effectively computable answer?

For those of you doing these computations, it might be nice to tally
those a less than (say) 1000 for which no prime could be found for b up to
(say) 12 or 13.
This looks quite easy to do, so I might give this a go.

I have sieved b=14 for the first 100,000 values of a for all possible prime factors up to 2^31 (=2^16*2^15+1 in fact) and 31652 candidates remain. Although the sieve instructions mention that you need to do two sieves int(odd)*2^15+1 and then int(odd)*2^16+1, this misses out some important possible factors where int is even. So I had to construct multiple layers of sieve int(odd)*2^(15+x), x integer, to ensure that all int(even) were considered by the sieve.

Last fiddled with by robert44444uk on 2009-06-09 at 10:32
robert44444uk is offline   Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Sieve needed for k*b1^m*b2^n+1 beyastard Software 58 2023-05-27 19:11
More NFS@Home 16e Lattice Sieve V5 wu's needed pinhodecarlos NFS@Home 46 2018-03-12 22:43
Advantage of lattice sieve over line sieve binu Factoring 3 2013-04-13 16:32
Help needed AntonVrba Math 3 2007-03-06 10:55
Volunteer needed for sieve merging MooMoo2 Twin Prime Search 9 2007-01-01 21:13

All times are UTC. The time now is 13:50.


Fri Jul 7 13:50:18 UTC 2023 up 323 days, 11:18, 0 users, load averages: 1.12, 1.19, 1.14

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.

≠ ± ∓ ÷ × · − √ ‰ ⊗ ⊕ ⊖ ⊘ ⊙ ≤ ≥ ≦ ≧ ≨ ≩ ≺ ≻ ≼ ≽ ⊏ ⊐ ⊑ ⊒ ² ³ °
∠ ∟ ° ≅ ~ ‖ ⟂ ⫛
≡ ≜ ≈ ∝ ∞ ≪ ≫ ⌊⌋ ⌈⌉ ∘ ∏ ∐ ∑ ∧ ∨ ∩ ∪ ⨀ ⊕ ⊗ 𝖕 𝖖 𝖗 ⊲ ⊳
∅ ∖ ∁ ↦ ↣ ∩ ∪ ⊆ ⊂ ⊄ ⊊ ⊇ ⊃ ⊅ ⊋ ⊖ ∈ ∉ ∋ ∌ ℕ ℤ ℚ ℝ ℂ ℵ ℶ ℷ ℸ 𝓟
¬ ∨ ∧ ⊕ → ← ⇒ ⇐ ⇔ ∀ ∃ ∄ ∴ ∵ ⊤ ⊥ ⊢ ⊨ ⫤ ⊣ … ⋯ ⋮ ⋰ ⋱
∫ ∬ ∭ ∮ ∯ ∰ ∇ ∆ δ ∂ ℱ ℒ ℓ
𝛢𝛼 𝛣𝛽 𝛤𝛾 𝛥𝛿 𝛦𝜀𝜖 𝛧𝜁 𝛨𝜂 𝛩𝜃𝜗 𝛪𝜄 𝛫𝜅 𝛬𝜆 𝛭𝜇 𝛮𝜈 𝛯𝜉 𝛰𝜊 𝛱𝜋 𝛲𝜌 𝛴𝜎𝜍 𝛵𝜏 𝛶𝜐 𝛷𝜙𝜑 𝛸𝜒 𝛹𝜓 𝛺𝜔