I was investigating primes with the property that the sum of the first $n$ primes is divisible by $p_n$. It turns out that these primes are extremely extremely rare. For primes less than $10^9$, I have found that there are only five primes with this property:

$$ p_1 = 2 $$

$$ p_3 = 5 $$

$$ p_{20} = 71 $$

$$ p_{31464} = 369,119 $$

$$ p_{22096548} = 415,074,643 $$

This raises the curious and equivalent questions:

Q1. Are there infinitely many primes which divide the sum of all the preceding primes?

Q2. Even if we assume that there are infinitely many such primes, why are they so rare? In other words, why do primes dislike dividing the sum of all the preceding primes? Is there any heuristic argument to show that such primes will indeed be extremely rare?


2 Answers 2


Here is a heuristic argument that there is nothing to explain:

The probability that $p$ divides the sum of the preceding primes is $1/p$. So the expected number of primes less than $10^9$ with this property is $\sum_{p \leq 10^9} \frac{1}{p}$. Using Mertens' second theorem, $$\sum_{p \leq 10^9} \frac{1}{p} \approx \log \log 10^9 + M \approx 3.3$$

Here $\log$ is natural log and $M \approx 0.26149$ is Mertens' constant.

This is an example of the motto "$\log \log x$ goes to infinity but has never been observed to do so". It is quite common for people to look at primes $p$ which divide some quantity $a_p$ and conclude that they are surprisingly rare when, in fact, they are simply growing as $\log \log N$ for the reason above.

  • 7
    $\begingroup$ So the point is that any problem like this must be compared to $\log \log N$. But to get any good estimates of the comparison is extremely hard, because $\log\log N$ is so much smaller than $\infty$. For example, in the problem above, based on $N = 10^9$, we could argue that in fact primes very much do like to divide the sum of their predecessors, as there are in fact 5 primes with this property, which is fifty percent more than the expected number. $\endgroup$ Feb 1, 2013 at 20:18
  • 4
    $\begingroup$ Why is the probability $1/p$? $\endgroup$ Feb 2, 2013 at 0:52
  • 14
    $\begingroup$ @Filippo Alberto Edoardo: It is a heuristic (as said in the answer) but one that in this cases seems to make perfect sense: the sum of the primes preceeding $p$ is a number significantly larger than $p$ (about size $p^2/ (2 \log p)$ , I think) and there seems no reason for it being biased towards being in any particular residue class moduo $p$; so that it is $0$ mod $p$ seems just as likely as it being anything else, so prop. $1/p$ for it being $0$, ie divisible by $p$. This is the natural heuristic in this case, and explains the scarcity. To make this heuristic precise, seems very hard. $\endgroup$
    – user9072
    Feb 2, 2013 at 12:48
  • 2
    $\begingroup$ Thanks, I did not intepret the $1/p$ as being the sentence "lie in one of the $p$ classes $\mod{p}$". $\endgroup$ Jan 22, 2014 at 23:53
  • 8
    $\begingroup$ (Nitpicking: The guy's name was Mertens, not Merten.) $\endgroup$ Feb 19, 2014 at 11:25

Question Q1 seems to me an extremely hard problem, but I also believe that the answer is affirmative because the heuristic argument exposed by David Speyer.

I studied with FLorian Luca [1] a related problem that could help to answer question Q2:

Let $A$ the set of integers $n$ such that the sum of the first n primes is divisible by $n$ (instead of $p_n$). In other words, $A$ is the set of $n$ such that the arithmetic mean of the first $n$ primes is an integer:

$A=\{ n: \frac{p_1+\cdots +p_n}n \in \mathbf Z \}=\{ 1, 23, 53, 853, 11869, 117267, 339615, 3600489,..\} $

These numbers are not so rare because in this case the heuristic gives $ A(x)\asymp \sum_{n\le x}\frac 1n\sim \log x$.

We could not prove that $A$ has infinite elements but we proved that they are rare:

$$A(x)\ll x e^{-C(\log x)^{3/5}(\log \log x)^{-1/5}}.$$ Later Matomaki [2] proved the stronger estimate, $A(x)\ll x^{\frac{19}{24}+\epsilon}$.

[1] Cilleruelo, Javier; Luca, Florian, On the sum of the first n primes. Q. J. Math. 59 (2008), no. 4. http://www.uam.es/personal_pdi/ciencias/cillerue/articulos.html

[2] Matomäki, Kaisa, A note on the sum of the first n primes. Q. J. Math. 61 (2010), no. 1,


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.