Probability for the sum of two random numbers being a prime number? Suppose $N$ is a (large) fixed positive integer, and one is asked to randomly choose any two integers (numbers could be same as well) from $1$ to $N$ (including $1$ and $N$). Let the experiment be repeated $M$ times and the choices of numbers be $\{a_1,b_1\},\dots,\{a_M,b_M\}$. Let $P_N(M)$ be the number of pairs $\{a_i,b_i\}$ whose sum $a_i+b_i$ is a prime. Define $P_N=\displaystyle Lim_{M\rightarrow \infty}(P_N(M)/M)$. Are there any results known for $P_N$ ? 
 A: It will be roughly $1/\log N$ since you're effectively choosing a random number near $N$. The exact number can be computed if you care to put in that much effort. For example, with $N=10^6$ the probability is 7.3056967061% (exactly, if I haven't made any mistakes), compared to the approximation 7.238...% you get with the log.
A: Since you're taking the limit as $M \to \infty$, you're really asking for the exact probability that a given choice of two numbers from $1$ to $N$ will add up to give a prime.  You need two ingredients to compute this.  First, you need an approximation for the probability that $n$ is prime for a number $n$.  This can be gleaned from a prime counting function, pointed out by another post.  A fairly good approximation for the probability that $n$ is prime, as indicated, is $f(n) = 1 / \ln(n)$.  Or even better is $f(n) = 1 / ((\ln (n \ln n) - 1) + (\ln \ln n - 2) / \ln n))$.  Now you want to sum/integrate this from $n = 2,3,\ldots,2N$ assuming $n$ is the sum of two random numbers between $1$ and $N$.  Note the probability of getting value $n$ from the 2 numbers you add is $(n-1)/N^2$ if $n \leq N$, and $(2N - n + 1)/N^2$ if $n > N$.  So you can break up your sum/integral into two parts, and e.g. use numerical integration via Riemann-sum style methods for large enough $n$, or approximation using Taylor series of $f(n)$ for large enough $n$, say centered at some fairly large value of $n=n'$ and then also just using a computer to evaluate the probability for the first values of $n \leq n'$, using exact computation based on whether $n$ is prime or not.
A: Not sure but I think this may be of use: Prime-counting function
