TOPICS
Search

Prime Sums


PrimeSum

Prime sums are sums taken over primes. They include the sum of the first n primes,

 Sigma(n)=sum_(i=1)^np_i,
(1)

where n is a positive integer and p_i is the ith prime. This is the sum analog of the primorial function. The first few terms are 2, 5, 10, 17, 28, 41, 58, 77, ... (OEIS A007504). Bach and Shallit (1996) show that

 Sigma(n)∼1/2n^2lnn,
(2)

and provide a general technique for estimating such sums.

For a real number x>=2, let

 S(x)=sum_(p<=x)p=Sigma(pi(x)),
(3)

where the sum is over primes and pi is the prime counting function. The prime number theorem gives pi(x)∼x/lnx, so the preceding estimate implies

 S(x)∼(x^2)/(2lnx).
(4)

Since p_m∼mlnm and lnS(x)∼2lnx, it follows that

 p_(S(x))∼S(x)lnS(x)∼x^2.
(5)

Here x is the upper cutoff on the primes being summed, rather than their number.

For n>=15, the sharp upper bound is

 Sigma(n)<=C/2n^2lnn<0.541026n^2lnn,
(6)

where

C=(1605624788346)/(341276^2ln341276)
(7)
=1.0820514451923950650...
(8)

(OEIS A182170; F. M. Jackson, pers. comm., May 10, 2012). Equality in the first inequality holds only for n=341276, when Sigma(n)=802812394173. The bound follows from direct computation for 15<=n<1897700 and the explicit estimate of Axler (2019, p. 297) for larger n.

The first few values of n such that Sigma(n) is prime are 1, 2, 4, 6, 12, 14, 60, 64, 96, 100, ... (OEIS A013916). The corresponding values of Sigma(n) are 2, 5, 17, 41, 197, 281, 7699, 8893, 22039, 24133, ... (OEIS A013918).

The first few values of n such that n|Sigma(n) are 1, 23, 53, 853, 11869, 117267, 339615, 3600489, 96643287, ... (OEIS A045345). The corresponding values of Sigma(n) are 2, 874, 5830, 2615298, 712377380, 86810649294, 794712005370, 105784534314378, 92542301212047102, ... (OEIS A050247; Rivera), and the values of Sigma(n)/n are 2, 38, 110, 3066, 60020, 740282, 2340038, 29380602, 957565746, ... (OEIS A050248; Rivera).

In 1737, Euler showed that the harmonic series of primes, (i.e., sum of the reciprocals of the primes) diverges

 sum_(k=1)^infty1/(p_k)=infty
(9)

(Nagell 1951, p. 59; Hardy and Wright 1979, pp. 17 and 22), although it does so very slowly.

A rapidly converging series for the Mertens constant

 B_1=gamma+sum_(k=1)^infty[ln(1-p_k^(-1))+1/(p_k)]
(10)

is given by

 B_1=gamma+sum_(m=2)^infty(mu(m))/mln[zeta(m)],
(11)

where gamma is the Euler-Mascheroni constant, zeta(n) is the Riemann zeta function, and mu(n) is the Möbius function (Flajolet and Vardi 1996, Schroeder 1997, Knuth 1998).

Dirichlet showed the even stronger result that

 sum_(prime p=b (mod a); (a,b)=1)1/p=infty
(12)

(Davenport 1980, p. 34). Despite the divergence of the sum of reciprocal primes, the alternating series

 sum_(k=1)^infty((-1)^k)/(p_k) approx -0.2696063519
(13)

(OEIS A078437) converges (Robinson and Potter 1971), but it is not known if the sum

 sum_(k=1)^infty(-1)^kk/(p_k)
(14)

does (Guy 1994, p. 203; Erdős 1998; Finch 2003).

There are also classes of sums of reciprocal primes with sign determined by congruences on p_k, for example

 sum_(k=2)^infty(c_k)/(p_k) approx 0.3349813253
(15)

(OEIS A086239), where

 c_k={-1   for p_k=1 (mod 4); 1   for p_k=3 (mod 4)
(16)

(Glaisher 1891b; Finch 2003; Jameson 2003, p. 177),

 sum_(k=2)^infty(c_k)/(p_k^2) approx 0.0946198928
(17)

(OEIS A086240; Glaisher 1893, Finch 2003), and

 sum_(k=1)^infty(d_k)/(p_k) approx 0.6419448385
(18)

(OEIS A086241), where

 d_k={-1   for p_k=1 (mod 3); 1   for p_k=2 (mod 3); 0   for p_k=0 (mod 3)
(19)

(Glaisher 1891c; Finch 2003; Jameson 2003, p. 177).

Although sum1/p diverges, Brun (1919) showed that

 sum_(p,p+2 prime)(1/p+1/(p+2))=B<infty,
(20)

where B is Brun's constant. Its numerical value is estimated as

 B approx 1.90216058
(21)

(OEIS A065421). The estimate uses extrapolation of the uncomputed tail.

The function defined by

 P(n)=sum_(k=1)^infty1/(p_k^n)
(22)

taken over the primes converges for n>1 and is a generalization of the Riemann zeta function known as the prime zeta function.

Consider the positive integers n_o with prime factorizations

 n_o=p_1^(alpha_1)p_2^(alpha_2)...p_r^(alpha_r),
(23)

where the p_k are distinct primes, the alpha_k are positive integers, and sum_(k=1)^(r)alpha_k is odd. Thus there are an odd number of prime factors, counted with multiplicity. The first few such numbers are 2, 3, 5, 7, 8, 11, 12, 13, 17, 18, 19, 20, 23, 27, 28, 29, ... (OEIS A026424). For a positive integer p,

P_o(2p)=sum_(n_o)1/(n_o^(2p))
(24)
=1/(2^(2p))+1/(3^(2p))+1/(5^(2p))+1/(7^(2p))+1/(8^(2p))+...
(25)
=([zeta(2p)]^2-zeta(4p))/(2zeta(2p)),
(26)

(Gourdon and Sebah), where zeta(p) is the Riemann zeta function. The first few terms are then

P_o(2)=(pi^2)/(20)
(27)
P_o(4)=(pi^4)/(1260)
(28)
P_o(6)=(4pi^6)/(225225)
(29)
P_o(8)=(59pi^8)/(137837700)
(30)

(OEIS A093597 and A093598).

Consider the analogous sum over squarefree integers n_(od) having an odd number of prime factors, i.e., sum_(k=1)^(r)alpha_k is odd and max_(k)(alpha_k)=1. The first few such numbers are 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 30, 31, 37, 41, 42, ... (OEIS A030059), which include the composite numbers 30, 42, 66, 70, 78, 102, ... (OEIS A093599). Then

P_(od)(2p)=sum_(n_(od))1/(n_(od)^(2p))
(31)
=1/(2^(2p))+1/(3^(2p))+1/(5^(2p))+1/(7^(2p))+...+1/(30^(2p))+1/(31^(2p))+...
(32)
=([zeta(2p)]^2-zeta(4p))/(2zeta(2p)zeta(4p)),
(33)

(Gourdon and Sebah). The first few terms are then

P_(od)(2)=9/(2pi^2)
(34)
P_(od)(4)=(15)/(2pi^4)
(35)
P_(od)(6)=(11340)/(691pi^6)
(36)
P_(od)(8)=(278775)/(7234pi^8)
(37)

(OEIS A093595 and A093596).

The sum

T=sum_(k=1)^(infty)1/((p_k-1)^2)
(38)
=sum_(k=2)^(infty)(phi_2(k)-phi(k))/kln[zeta(k)]
(39)
=1.3750649947...
(40)

(OEIS A086242) is also finite (Glaisher 1891a; Cohen; Finch 2003), where

 phi_l(k)=k^lproduct_(p|k)(1-1/(p^l)),
(41)

phi(n) is the totient function, and zeta(k) is the Riemann zeta function.

Some curious sums satisfied by primes p include

 sum_(k=1)^(p-1)|_(k^3)/p_|=((p-2)(p-1)(p+1))/4,
(42)

giving the sequence 0, 2, 18, 60, 270, 462, 1080, ... (OEIS A078837; Doster 1993) for p=2, 3, 5, ..., and

 sum_(k=1)^((p-1)(p-2))|_(kp)^(1/3)_|=1/4(3p-5)(p-2)(p-1),
(43)

giving the sequence 0, 2, 30, 120, 630, 1122, 2760, ... (OEIS A078838; Doster 1993),

 sum_(i,j=1)^(p-1)|_(ij)/p_|=((p-1)^3-(p-1)^2)/4=((p-2)(p-1)^2)/4,
(44)

giving the sequence 0, 1, 12, 45, 225, 396, 960, 1377, ... (OEIS A331764; J.-C. Babois, pers. comm., Jan. 31, 2021),

sum_(k=1)^(infty)x^klnk=sum_(k=1)^(infty)(Lambda(k)x^k)/(1-x^k)
(45)
=sum_(p)lnpsum_(k=1)^(infty)(x^(p^k))/(1-x^(p^k)),
(46)

for |x|<1, where Lambda(k) is the Mangoldt function, and

 sum_(k=1)^infty(-1)^(k-1)e^(-kx)lnk=-ln2sum_(k=1)^infty1/(e^(2^kx)-1)+sum_(p>2)lnpsum_(k=1)^infty1/(e^(p^kx)+1)
(47)

for real x>0 (Berndt 1994, p. 114).

Let f(n) be the number of ways an integer n can be written as a sum of two or more consecutive primes. For example, 5=2+3, so f(5)=1 and 36=5+7+11+13=17+19, so f(36)=2. The sequence of values of f(n) for n=1, 2, ... is given by 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, ... (OEIS A084143). The following table gives the first few n such that f(n)>=k for small k.

kOEISvalues of n such that f(n)>=k
1A0509365, 8, 10, 12, 15, 17, 18, 23, 24, 26, 28, 30, 31, 36, ...
2A06737236, 41, 60, 72, 83, 90, 100, 112, 119, ...
3A067373240, 287, 311, 340, 371, 510, 660, 803, ...

Similarly, the following table gives the first few n such that f(n)=k for small k.

kOEISvalues of n such that f(n)=k
1A0841465, 8, 10, 12, 15, 17, 18, 23, 24, 26, 28, 30, 31, 39, ...
2A08414736, 41, 60, 72, 83, 90, 100, 112, 119, 120, 138, ...
PrimeSumLn2

Now consider instead the number g(n) of ways in which a number n can be represented as a sum of one or more consecutive primes (i.e., the same sequence as before but one larger for each prime number). Amazingly, it then turns out that

 lim_(n->infty)1/nsum_(k=1)^ng(k)=ln2
(48)

(Moser 1963; Le Lionnais 1983, p. 30).


See also

Bruns Constant, Harmonic Series of Primes, Mertens Constant, Mertens Second Theorem, Prime Formulas, Prime Number, Prime Products, Prime Zeta Function, Primorial, Sum of Prime Factors

Portions of this entry contributed by Jean-Claude Babois

Explore with Wolfram|Alpha

References

Axler, C. "On the Sum of the First n Prime Numbers." J. Théor. Nombres Bordeaux 31, 293-311, 2019. https://doi.org/10.5802/jtnb.1081.Bach, E. and Shallit, J. §2.7 in Algorithmic Number Theory, Vol. 1: Efficient Algorithms. Cambridge, MA: MIT Press, 1996.Berndt, B. C. "Ramanujan's Theory of Prime Numbers." Ch. 24 in Ramanujan's Notebooks, Part IV. New York: Springer-Verlag, 1994.Brun, V. "La serie 1/5+1/7+1/11+1/13+1/17+1/19+1/29+1/31+1/41+1/43+1/59+1/61+..., les dénominateurs sont nombres premiers jumeaux est convergente où finie." Bull. Sci. Math. 43, 124-128, 1919.Cohen, H. "High Precision Computation of Hardy-Littlewood Constants." Preprint. https://www.math.u-bordeaux.fr/~hecohen/hardylw.dvi.Davenport, H. Multiplicative Number Theory, 2nd ed. New York: Springer-Verlag, 1980.Doster, D. "Problem 10346." Amer. Math. Monthly 100, 951, 1993.Erdős, P. "Some of My New and Almost New Problems and Results in Combinatorial Number Theory." In Number Theory: Diophantine, Computational and Algebraic Aspects. Proceedings of the International Conference Held in Eger, July 29-August 2, 1996 (Ed. K. Győry, A. Pethő and V. T. Sós). Berlin, Germany: de Gruyter, pp. 169-180, 1998.Finch, S. "Two Asymptotic Series." Dec. 10, 2003. https://web.archive.org/web/20160419150604/http://www.people.fas.harvard.edu/~sfinch/csolve/asym.pdf.Finch, S. R. "Meissel-Mertens Constants." §2.2 in Mathematical Constants. Cambridge, England: Cambridge University Press, pp. 94-98, 2003.Flajolet, P. and Vardi, I. "Zeta Function Expansions of Classical Constants." Unpublished manuscript. 1996. https://algo.inria.fr/flajolet/Publications/landau.ps.Glaisher, J. W. L. "On the Sums of the Inverse Powers of the Prime Numbers." Quart. J. Pure Appl. Math. 25, 347-362, 1891a.Glaisher, J. W. L. "On the Series 1/3-1/5+1/7+1/11-1/13-...." Quart. J. Pure Appl. Math. 25, 375-383, 1891b.Glaisher, J. W. L. "On the Series 1/2+1/5-1/7+1/11-1/13-...." Quart. J. Pure Appl. Math. 25, 48-65, 1891c.Glaisher, J. W. L. "On the Series 1/3^2-1/5^2+1/7^2+1/11^2-1/13-...." Quart. J. Pure Appl. Math. 26, 33-47, 1893.Gourdon, X. and Sebah, P. "Collection of Series for pi." http://numbers.computation.free.fr/Constants/Pi/piSeries.html.Guy, R. K. "A Series and a Sequence Involving Primes." §E7 in Unsolved Problems in Number Theory, 2nd ed. New York: Springer-Verlag, p. 203, 1994.Hardy, G. H. and Wright, E. M. "Prime Numbers" and "The Sequence of Primes." §1.2 and 1.4 in An Introduction to the Theory of Numbers, 5th ed. Oxford, England: Clarendon Press, pp. 1-4, 17, 22, and 251, 1979.Jameson, G. J. O. The Prime Number Theorem. Cambridge, England: Cambridge University Press, p. 177, 2003.Knuth, D. E. The Art of Computer Programming, Vol. 2: Seminumerical Algorithms, 3rd ed. Reading, MA: Addison-Wesley, 1998.Le Lionnais, F. Les nombres remarquables. Paris, France: Hermann, pp. 26, 30, and 46, 1983.Moree, P. "Approximation of Singular Series and Automata." Manuscripta Math. 101, 385-399, 2000.Moser, L. "Notes on Number Theory III. On the Sum of Consecutive Primes." Can. Math. Bull. 6, 159-161, 1963.Nagell, T. Introduction to Number Theory. New York: Wiley, 1951.Ramanujan, S. "Irregular Numbers." J. Indian Math. Soc. 5, 105-106, 1913.Ramanujan, S. Collected Papers of Srinivasa Ramanujan (Ed. G. H. Hardy, P. V. S. Aiyar, and B. M. Wilson). Providence, RI: Amer. Math. Soc., pp. 20-21, 2000.Rivera, C. "Problems & Puzzles: Puzzle 031-The Average Prime Number, APN(k)=S(p_k)/k." https://www.primepuzzles.net/puzzles/puzz_031.htm.Robinson, H. P. and Potter, E. Mathematical Constants. Report UCRL-20418. Berkeley, CA: University of California, 1971.Schroeder, M. R. Number Theory in Science and Communication, with Applications in Cryptography, Physics, Digital Information, Computing, and Self-Similarity, 3rd ed. New York: Springer-Verlag, 1997.Sloane, N. J. A. Sequences A007504/M1370, A013916, A013918, A026424, A030059, A045345, A046024, A050247, A050248, A050936, A065421, A067372, A067373, A078437, A078837, A078838, A084143, A084146, A084147, A086239, A086240, A086241, A086242, A093595, A093596, A093597, A093598, A093599, A182170, and A331764 in "The On-Line Encyclopedia of Integer Sequences."

Referenced on Wolfram|Alpha

Prime Sums

Cite this as:

Weisstein, Eric W., with contributions by Jean-Claude Babois. "Prime Sums." From MathWorld--A Wolfram Resource. https://mathworld.wolfram.com/PrimeSums.html

Subject classifications