cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-5 of 5 results.

A007504 Sum of the first n primes.

Original entry on oeis.org

0, 2, 5, 10, 17, 28, 41, 58, 77, 100, 129, 160, 197, 238, 281, 328, 381, 440, 501, 568, 639, 712, 791, 874, 963, 1060, 1161, 1264, 1371, 1480, 1593, 1720, 1851, 1988, 2127, 2276, 2427, 2584, 2747, 2914, 3087, 3266, 3447, 3638, 3831, 4028, 4227, 4438, 4661, 4888
Offset: 0

Views

Author

Keywords

Comments

It appears that a(n)^2 - a(n-1)^2 = A034960(n). - Gary Detlefs, Dec 20 2011
This is true. Proof: By definition we have A034960(n) = Sum_{k = (a(n-1)+1)..a(n)} (2*k-1). Since Sum_{k = 1..n} (2*k-1) = n^2, it follows A034960(n) = a(n)^2 - a(n-1)^2, for n > 1. - Hieronymus Fischer, Sep 27 2012 [formulas above adjusted to changed offset of A034960 - Hieronymus Fischer, Oct 14 2012]
Row sums of the triangle in A037126. - Reinhard Zumkeller, Oct 01 2012
Ramanujan noticed the apparent identity between the prime parts partition numbers A000607 and the expansion of Sum_{k >= 0} x^a(k)/((1-x)...(1-x^k)), cf. A046676. See A192541 for the difference between the two. - M. F. Hasler, Mar 05 2014
For n > 0: row 1 in A254858. - Reinhard Zumkeller, Feb 08 2015
a(n) is the smallest number that can be partitioned into n distinct primes. - Alonso del Arte, May 30 2017
For a(n) < m < a(n+1), n > 0, at least one m is a perfect square.
Proof: For n = 1, 2, ..., 6, the proposition is clear. For n > 6, a(n) < ((prime(n) - 1)/2)^2, set (k - 1)^2 <= a(n) < k^2 < ((prime(n) + 1)/2)^2, then k^2 < (k - 1)^2 + prime(n) <= a(n) + prime(n) = a(n+1), so m = k^2 is this perfect square. - Jinyuan Wang, Oct 04 2018
For n >= 5 we have a(n) < ((prime(n)+1)/2)^2. This can be shown by noting that ((prime(n)+1)/2)^2 - ((prime(n-1)+1)/2)^2 - prime(n) = (prime(n)+prime(n-1))*(prime(n)-prime(n-1)-2)/4 >= 0. - Jianing Song, Nov 13 2022
Washington gives an oscillation formula for |a(n) - pi(n^2)|, see links. - Charles R Greathouse IV, Dec 07 2022

References

  • E. Bach and J. Shallit, §2.7 in Algorithmic Number Theory, Vol. 1: Efficient Algorithms, MIT Press, Cambridge, MA, 1996.
  • H. L. Nelson, "Prime Sums", J. Rec. Math., 14 (1981), 205-206.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

See A122989 for the value of Sum_{n >= 1} 1/a(n).

Programs

  • GAP
    P:=Filtered([1..250],IsPrime);;
    a:=Concatenation([0],List([1..Length(P)],i->Sum([1..i],k->P[k]))); # Muniru A Asiru, Oct 07 2018
    
  • Haskell
    a007504 n = a007504_list !! n
    a007504_list = scanl (+) 0 a000040_list
    -- Reinhard Zumkeller, Oct 01 2014, Oct 03 2011
    
  • Magma
    [0] cat [&+[ NthPrime(k): k in [1..n]]: n in [1..50]]; // Bruno Berselli, Apr 11 2011 (adapted by Vincenzo Librandi, Nov 27 2015 after Hasler's change on Mar 05 2014)
    
  • Maple
    s1:=[2]; for n from 2 to 1000 do s1:=[op(s1),s1[n-1]+ithprime(n)]; od: s1;
    A007504 := proc(n)
        add(ithprime(i), i=1..n) ;
    end proc: # R. J. Mathar, Sep 20 2015
  • Mathematica
    Accumulate[Prime[Range[100]]] (* Zak Seidov, Apr 10 2011 *)
    primeRunSum = 0; Table[primeRunSum = primeRunSum + Prime[k], {k, 100}] (* Zak Seidov, Apr 16 2011 *)
  • PARI
    A007504(n) = sum(k=1,n,prime(k)) \\ Michael B. Porter, Feb 26 2010
    
  • PARI
    a(n) = vecsum(primes(n)); \\ Michel Marcus, Feb 06 2021
    
  • Python
    from itertools import accumulate, count, islice
    from sympy import prime
    def A007504_gen(): return accumulate(prime(n) if n > 0 else 0 for n in count(0))
    A007504_list = list(islice(A007504_gen(),20)) # Chai Wah Wu, Feb 23 2022

Formula

a(n) ~ n^2 * log(n) / 2. - Ahmed Fares (ahmedfares(AT)my-deja.com), Apr 24 2001 (see Bach & Shallit 1996)
a(n) = A014284(n+1) - 1. - Jaroslav Krizek, Aug 19 2009
a(n+1) - a(n) = A000040(n+1). - Jaroslav Krizek, Aug 19 2009
a(A051838(n)) = A002110(A051838(n)) / A116536(n). - Reinhard Zumkeller, Oct 03 2011
a(n) = min(A068873(n), A073619(n)) for n > 1. - Jonathan Sondow, Jul 10 2012
a(n) = A033286(n) - A152535(n). - Omar E. Pol, Aug 09 2012
For n >= 3, a(n) >= (n-1)^2 * (log(n-1) - 1/2)/2 and a(n) <= n*(n+1)*(log(n) + log(log(n))+ 1)/2. Thus a(n) = n^2 * log(n) / 2 + O(n^2*log(log(n))). It is more precise than in Fares's comment. - Vladimir Shevelev, Aug 01 2013
a(n) = (n^2/2)*(log n + log log n - 3/2 + (log log n - 3)/log n + (2 (log log n)^2 - 14 log log n + 27)/(4 log^2 n) + O((log log n/log n)^3)) [Sinha]. - Charles R Greathouse IV, Jun 11 2015
G.f: (x*b(x))/(1-x), where b(x) is the g.f. of A000040. - Mario C. Enriquez, Dec 10 2016
a(n) = A008472(A002110(n)), for n > 0. - Michel Marcus, Jul 16 2020

Extensions

More terms from Stefan Steinerberger, Apr 11 2006
a(0) = 0 prepended by M. F. Hasler, Mar 05 2014

A068873 Smallest prime which is a sum of n distinct primes.

Original entry on oeis.org

2, 5, 19, 17, 43, 41, 79, 83, 127, 131, 199, 197, 283, 281, 379, 389, 499, 509, 643, 641, 809, 809, 983, 971, 1171, 1163, 1381, 1373, 1609, 1607, 1861, 1861, 2137, 2137, 2437, 2441, 2749, 2767, 3109, 3109, 3457, 3457, 3833, 3847, 4243, 4241, 4663, 4679, 5119
Offset: 1

Views

Author

Amarnath Murthy, Mar 19 2002

Keywords

Comments

Conjectured terms a(50)-a(76): 5147, 5623, 5591, 6079, 6101, 6599, 6607, 7151, 7151, 7699, 7699, 8273, 8293, 8893, 8893, 9521, 9547, 10211, 10223, 10889, 10891, 11597, 11617, 12343, 12373, 13099, 13127. - Jean-François Alcover, Apr 22 2020

Examples

			a(3) = 19 as 19 is the smallest prime which can be expressed as the sum of three primes as 19 = 3 + 5 + 11.
a(4) = 17= 2+3+5+7. a(2)=A038609(1). a(3)=A124867(7). Further examples in A102330.
		

References

  • Shantanu Dey & Moloy De, Two conjectures on prime numbers, Journal of Recreational Mathematics, Vol. 36 (3), pp 205-206. Baywood Publ. Co, Amityville NY 2011.

Crossrefs

Programs

  • Maple
    # Number of ways to write n as a sum of k distinct primes, the smallest
    # being smalp
    sumkprims := proc(n,k,smalp)
        option remember;
        local a,res,pn;
        res := n-smalp ;
        if res < 0 then
            return 0;
        elif res > 0 and k <=0 then
            return 0;
        elif res = 0 and k = 1 then
            return 1;
        else
            pn := nextprime(smalp) ;
            a := 0 ;
            while pn <= res do
                a := a+procname(res,k-1,pn) ;
                pn := nextprime(pn) ;
            end do:
            a ;
        end if;
    end proc:
    # Number of ways of writing n as a sum of k distinct primes
    A000586k := proc(n,k)
        local a,i,smalp ;
        a := 0 ;
        for i from 1 do
            smalp := ithprime(i) ;
            if k*smalp > n then
                return a;
            end if;
            a := a+sumkprims(n,k,smalp) ;
        end do:
    end proc:
    # Smallest prime which is a sum of n distinct primes
    A068873 := proc(n)
        local a,i;
        a := A007504(n) ;
        a := nextprime(a-1) ;
        for i from 1 do
            if A000586k(a,n) > 0 then
                return a;
            end if;
            a := nextprime(a) ;
        end do:
    end proc: # R. J. Mathar, May 04 2014
  • PARI
    a(n)=
    {
        my(P=primes(n), k=n, t, res = oo);
        while(1,
            forvec(v=vector(n-1, i, [1, k-1]),
                t=sum(i=1, n-1, P[v[i]])+P[k];
                if(isprime(t),
    		res = min(res, t);
    	   )
            ,
                2 \\ flag: only strictly increasing vectors v
            );
            P=concat(P, nextprime(P[k]+1));
            k++;
    	if(P[k] + sum(i = 1+bitand(n,1), n-1+bitand(n,1), P[i]) > res,
    		return(res)
    	)
        );
    }
    \\ Charles R Greathouse IV, Sep 19 2015; corrected by David A. Corneth, May 12 2025

Formula

Min(a(n), A073619(n)) = A007504(n) for n > 1. - Jonathan Sondow, Jul 10 2012

Extensions

More terms from Sascha Kurz, Feb 03 2003
Corrected by Ray Chandler, Feb 02 2005

A073620 a(1) = 0; a(n) = smallest prime number which is a sum of n distinct composite numbers.

Original entry on oeis.org

0, 13, 19, 29, 37, 53, 67, 79, 97, 127, 137, 157, 179, 199, 227, 251, 277, 307, 337, 367, 401, 439, 479, 509, 547, 587, 631, 673, 709, 757, 809, 853, 907, 947, 997, 1049, 1103, 1163, 1217, 1277, 1361, 1399, 1451, 1523, 1579
Offset: 1

Views

Author

Amarnath Murthy, Aug 07 2002

Keywords

Crossrefs

Extensions

Corrected and extended by Antonio G. Astudillo (afg_astudillo(AT)lycos.com), Apr 18 2003

A073621 Smallest composite number which is a sum of n distinct composite numbers.

Original entry on oeis.org

4, 10, 18, 27, 39, 49, 63, 78, 94, 112, 132, 153, 175, 200, 224, 250, 278, 305, 335, 368, 400, 434, 469, 505, 543, 582, 622, 664, 708, 753, 799, 847, 896, 946, 998, 1052, 1104, 1158, 1214, 1271, 1329, 1389, 1452, 1514, 1578, 1643, 1711, 1778, 1846
Offset: 1

Views

Author

Amarnath Murthy, Aug 07 2002

Keywords

Crossrefs

Extensions

More terms from Sascha Kurz, Feb 03 2003
Duplicated a(15)-a(16) removed by Sean A. Irvine, Dec 11 2024

A387198 Smallest integer that can be expressed as the sum of k different primes, for all k’s between 2 and n, with n >= 2.

Original entry on oeis.org

2, 5, 10, 21, 28, 45, 58, 81, 106, 129, 166, 201, 238, 285, 338, 399, 440, 511, 572, 645, 718, 811, 888, 985, 1064, 1173, 1268, 1383, 1484, 1611, 1730, 1869, 1988, 2139, 2276, 2439, 2594, 2769, 2924, 3111, 3266, 3459, 3638, 3835, 4028, 4245, 4454, 4665, 4888, 5121, 5356
Offset: 1

Views

Author

Paolo P. Lava, Aug 21 2025

Keywords

Comments

Lower bounds are listed in A007504.

Examples

			a(2) = 5 because 5 = 2 + 3;
a(3) = 10 because 10 = 3 + 7 = 2 + 3 + 5;
a(4) = 21 because 21 = 2 + 19 = 3 + 5 + 13 = 2 + 3 + 5 + 11;
a(5) = 28 because 28 = 5 + 23 = 2 + 7 + 19 = 3 + 5 + 7 + 13 = 2 + 3 + 5 + 7 + 11; etc.
		

Crossrefs

Extensions

a(22) and more terms from David A. Corneth, Aug 21 2025
a(1) prepended by David A. Corneth, Aug 26 2025
Showing 1-5 of 5 results.