Seeking Help with a Calculation

  • MHB
  • Thread starter PeterJ1
  • Start date
  • Tags
    Calculation
In summary: I would add this number to P! to get the new estimate for P. This process would be repeated until I ran out of numbers to add. Then I'm done.This is a pretty accurate approximation for Rs as long as P is not too large. If P is larger than sqrtP!, then the sum of the reciprocals of the smallest and largest prime in the range will be smaller than P! and Q will be smaller than P! (since P! is the product of the reciprocals of the smallest and largest prime). In that case, Q will be less than P! and Rs will be inaccurate.In summary, Q
  • #1
PeterJ1
17
0
Hello folks. Newbie here. I hope this is the right place to post my question.

I'm trying to do a calculation and find it's beyond me. Here's the challenge.

Let S be the set of all primes up to P.
Let P! be the product of the primes in S.

For incrementally increasing values of P I want to calculate the square root of P! and estimate the quantity of primes between P and sqrtP! Then I want to add the reciprocals of those primes. Call this final result Rs (sum of reciprocals)

An exact figure is not required. I want to figure out where Rs is going as P increases.

Example. Where P = 7

P! = 210
Sqrt P! = 14-ish
Rs = 1/11 + 1/13

The range P to sqrtP! increases rapidly, and the only way to check how many primes there are in this range seems to be to look it up. But maybe there's a rough and ready method that would at least show the trend for Rs.

Can anyone help with this? If the question is not clear then my apologies.

I should add that I am not a mathematician so please keep it simple.

Many thanks.
 
Mathematics news on Phys.org
  • #2
PeterJ said:
Hello folks. Newbie here. I hope this is the right place to post my question.

I'm trying to do a calculation and find it's beyond me. Here's the challenge.

Let S be the set of all primes up to P.
Let P! be the product of the primes in S.

For incrementally increasing values of P I want to calculate the square root of P! and estimate the quantity of primes between P and sqrtP! Then I want to add the reciprocals of those primes. Call this final result Rs (sum of reciprocals)

An exact figure is not required. I want to figure out where Rs is going as P increases.

Example. Where P = 7

P! = 210
Sqrt P! = 14-ish
Rs = 1/11 + 1/13

The range P to sqrtP! increases rapidly, and the only way to check how many primes there are in this range seems to be to look it up. But maybe there's a rough and ready method that would at least show the trend for Rs.

Can anyone help with this? If the question is not clear then my apologies.

I should add that I am not a mathematician so please keep it simple.

Many thanks.
Hi PeterJ and welcome to MHB! For someone who is not a mathematician you have certainly come up with a challenging problem.

In fact, there are several asymptotic results about numbers and sums of primes (in other words, approximate estimates for what happens when the numbers become large).

The product of all the primes up to $P$ is called the primorial of $P$, denoted by $P\#$, and it is approximately equal to the exponential $e^P$ when $P$ is large. Its square root is therefore approximately $e^{P/2}$.

The number of primes less than $N$ is given by the prime number theorem as approximately $\dfrac N{\log N}$. (The logarithm here is the natural logarithm, the log to base $e$.) So the number of primes less than $\sqrt{P\#}$ is approximately $\dfrac{e^{P/2}}{P/2}= \dfrac{2e^{P/2}}P.$ The number of primes in the interval from $P$ to $\sqrt{P\#}$ is then approximately $\dfrac{2e^{P/2}}P - \dfrac P{\log P}.$

Finally, there is also an asymptotic formula for the sum of reciprocals of all the primes less than $X$, namely $\log\log X.$ So the sum of the reciprocals of primes in the interval from $P$ to $\sqrt{P\#}$ is approximately $\log\log\bigl(e^{P/2}\bigr) - \log\log P = \log(P/2) - \log\log P.$ Since $\log\log P$ is much smaller than $\log P$, a crude estimate for $Rs$ would be that it is of the order of $\log P$ when $P$ is very large.
 
  • #3
Thanks Opalg. This is very helpful. I cannot follow the calculations properly but I see the idea.

So I can use log P as an estimate for the primes in Rs. Just what I wanted to know. Many thanks.

I'm thinking now that I can roughly calculate Rs by taking the average of the reciprocals of the smallest and largest primes in the range and multiplying by log P. Does this make sense? If so I'm sorted.
 
  • #4
As usual I replied too hastily. It was a great answer but I realized later that I didn't fully understand it. Then I realized that I may be over-complicating things. Is what follows correct?

The product of the primes up to P is very soon so large compared to P that I might as well forget the primes below P. In this case all I need is an estimate for the quantity of primes up to P! using the PMT, which I imagine is an easy calculation. Let's call this Q.

Then I would pick a number in the middle of the range P to P! and multiply its reciprocal by Q for a very rough estimate of the sum of the reciprocals of the primes up to P!.

Then I would deduct the reciprocals of primes below P from this, and this would give me a very rough estimate for the sum of the reciprocals of the primes in Rs (the range P to P!).

Is this about right in principle?

If it is lunacy feel free to say so.

Thanks.
 
  • #5
PeterJ said:
The product of the primes up to P is very soon so large compared to P that I might as well forget the primes below P. In this case all I need is an estimate for the quantity of primes up to P! using the PMT, which I imagine is an easy calculation. Let's call this Q.
That is correct: $P!$ (which I call $P\#$) is so huge compared with $P$ that you can effectively ignore what happens below $P$. The estimate in my previous comment for $Q$ (the number of primes below $\sqrt{P\#}$) is that it is approximately $\dfrac{2e^{P/2}}P$.

PeterJ said:
Then I would pick a number in the middle of the range P to P! and multiply its reciprocal by Q for a very rough estimate of the sum of the reciprocals of the primes up to P!.

Then I would deduct the reciprocals of primes below P from this, and this would give me a very rough estimate for the sum of the reciprocals of the primes in Rs (the range P to P!).
In your initial post, you said that you wanted the primes between $P$ and $\sqrt{P\#}$. Now you are asking for the range from $P$ to $P\#$. I'll stick to the square root case, but if you want it without the square root that can be done too.

You don't need to estimate the sum of reciprocals of the primes in that range by taking an "average" prime in that range and multiplying by the number of primes. That would not be accurate enough to give you a valid estimate. My previous post gave a better estimate for that sum of reciprocals, namely that it is approximately $\log P.$
 
  • #6
Opalg said:
That is correct: $P!$ (which I call $P\#$) is so huge compared with $P$ that you can effectively ignore what happens below $P$. The estimate in my previous comment for $Q$ (the number of primes below $\sqrt{P\#}$) is that it is approximately $\dfrac{2e^{P/2}}P$.

In your initial post, you said that you wanted the primes between $P$ and $\sqrt{P\#}$. Now you are asking for the range from $P$ to $P\#$. I'll stick to the square root case, but if you want it without the square root that can be done too.

You don't need to estimate the sum of reciprocals of the primes in that range by taking an "average" prime in that range and multiplying by the number of primes. That would not be accurate enough to give you a valid estimate. My previous post gave a better estimate for that sum of reciprocals, namely that it is approximately $\log P.$

Oh yes. I meant P to P#.

Right. I think I get this now. This is the exact answer I needed so many thanks. I'll give it some more thought but I may be sorted now. Much appreciated...
 
  • #7
Thank you for your very clear replies, Opalg.

Now you've helped me simplify the problem I was able to find a table online. Here's my attempt to do the calc.

The 500th prime is 3571

The sum of the reciprocals of the primes to 3571 is 2.365328

3571 is the is the square root of 12752041, which is a bit larger than P# where P is 19.

So, roughly speaking, where P=19 I would need to deduct the sum of the reciprocals of 2,3,5,7,11,13,19 from 2.37 to give the sum of the reciprocals of the primes between P and sqrtP#.

Is this about right so far? The result doesn't have to be correct, I just need to get to an approximation. This seems to be a start, although I know there are still some complications.

I am trying to calculate the chances of a prime product landing at P#+/-1, or. rather, how the odds of this change as P grows larger. It seems to me the odds fall. This is because despite the massive increase in the number of possible prime divisors in the range P to sqrtP# for each step increase in P, the new P is the largest of them by far, so taking it out of the sum more than offsets the sum of all the tiny reciprocals that are being added each time.

Does this make sense? I might be way off.
 
Last edited:
  • #8
Hmm. No more replies so maybe I've gone off-piste.

I'll leave this one and come back with an updated and more clear question on a new thread.

Thanks.
 

FAQ: Seeking Help with a Calculation

How do I know which calculation method to use?

The calculation method you should use depends on the type of data you have and the desired outcome. It is important to carefully assess your data and determine the most appropriate method for your specific problem. Consulting with a subject matter expert or doing research on similar calculations can also help guide your decision.

How can I ensure the accuracy of my calculations?

To ensure the accuracy of your calculations, it is important to double-check your work and use reliable data. It is also recommended to use multiple methods to cross-check your results and to carefully follow any relevant formulas or equations. If possible, it is also helpful to have a colleague or peer review your calculations.

What are some common mistakes to avoid when performing calculations?

Some common mistakes to avoid when performing calculations include using incorrect or incomplete data, not following the correct order of operations, and not properly converting units of measurement. It is also important to carefully check for any errors in your equations or formulas and to be consistent with your calculations throughout the process.

How do I handle complex calculations with multiple variables?

Complex calculations with multiple variables can be challenging, but breaking them down into smaller, simpler steps can help. It is important to carefully define your variables and to use the correct symbols and units throughout the calculation. You may also find it helpful to use a spreadsheet or calculator to keep track of your calculations and ensure accuracy.

What resources are available for seeking help with a calculation?

There are many resources available for seeking help with a calculation, including online forums and communities, textbooks and online tutorials, and consulting with subject matter experts. It is also helpful to consult with colleagues or peers who may have experience with similar calculations. Additionally, many universities and research institutions have resources and services available for assistance with complex calculations.

Similar threads

Replies
2
Views
10K
Replies
11
Views
940
Replies
20
Views
8K
Replies
1
Views
1K
2
Replies
48
Views
10K
Replies
1
Views
2K
4
Replies
105
Views
13K
Back
Top