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-10 of 47 results. Next

A153089 Continue with summing & priming the A013918 list.

Original entry on oeis.org

2, 7, 117241, 1351781, 3703429, 243729623, 486707171, 568561471, 766634423, 883314979, 1058403331, 1520509423, 1933700891, 1997566367, 2063533819, 2632011079, 3040681037, 3591772153, 4114380107, 7870826569, 8414671219
Offset: 1

Views

Author

Michael J. Crowe (michaelcrowe117(AT)btinternet.com), Dec 18 2008

Keywords

Comments

If level 1 sum primes is the prime number list A000040, and level 2 sum primes is the list A013918 then the above list is level 3.
Continue with summing & priming for Level 4 sum primes which are
2, 50575480511, 158413287841, 379787123171, 88082548147771, 3939163325960453, 4342203121792903, 41672041797268133, 92013021551247323, 145937058697288751, 157891295660264779, 270930872865589619,...
Again continue with summing & priming for Level 5 sum primes which are
2, 50575480513, 1663807730918617976723, 14304824932873646803553, 28817336920092499216069, 20284632396728311969809131, 168804229342169123733371839, 909257309497199880752121319,...
Again continue with summing & priming for Level 6 sum primes which are
2, @Prime[1]
22388562459746799685433396747, @Prime[57000046]
????
Initially found using Mathematica then a NTL+C program using Miller-witness 10 trials. Checked summed primes with PrimeQ[].

Crossrefs

Programs

  • Mathematica
    lst2={}; s2=0; Do[s2=s2+Prime[n]; If[PrimeQ[s2], AppendTo[lst2, s2]], {n, 4700}]; lst3={}; s3=0; Do[s3=s3+lst2[[n]];If[PrimeQ[s3], AppendTo[lst3, s3]], {n,1,Length[lst2]}]; lst3

A189153 The number of primes in A013918 less than 10^n.

Original entry on oeis.org

2, 4, 6, 8, 22, 51, 118, 313, 796, 2022, 5460, 14756, 41508, 116504, 331022, 944930, 2716758, 7851206
Offset: 1

Views

Author

Henryk Dabrowski, Apr 17 2011

Keywords

Comments

It seems that sequence A013918 is infinite, but this has never been proved.

Crossrefs

Programs

  • Mathematica
    p = Select[Accumulate[Prime[Range[100000]]], PrimeQ]; Table[Length[Select[p, # < 10^n &]], {n, Floor[Log[10., p[[-1]]]]}] (* T. D. Noe, Apr 19 2011 *)
  • PARI
    PrimesInSumOfPrimes(n)=
    {
    local(p, s, w);
    p=s=w=0;
    while( s<=10^n,
           if( isprime(s), w++ );
           p = nextprime(p+1);
           s = s + p;
         );
    return(w);
    }

Formula

Let x=10^n, then a(n) has the asymptotic expression a(n)~0.475*li( sqrt(4x/log(4x)) )

A307470 Intersection of A013917 and A013918.

Original entry on oeis.org

2, 281, 25237, 1359329, 1603597, 6706397, 8300797, 32106383, 33262057, 33312781, 37233373, 57922687, 87938423, 124285471, 143031971, 144784201, 179684179, 185763283, 186515239, 229240489, 237863777, 248536159, 280322407, 298010851, 375529801, 481405411, 488236271, 498472207
Offset: 1

Views

Author

Torlach Rush, Apr 09 2019

Keywords

Comments

For a number to be a term of this sequence it must satisfy two similar but distinct conditions:
1. The number is prime and is the sum of consecutive primes.
2. The sum of all primes up to and including the number is also a prime number.
See examples below.

Examples

			2 is a term because 2 is prime and equals Sum_{2}. This is the trivial case.
281 is a term because 281 is prime and equals Sum_{2,3,...,41,43}, also Sum_{2,3,...,41,43,47,...,277,281} = 7699 which is also prime.
		

Crossrefs

Programs

  • PARI
    listp(nn) = {my(s=0); forprime(p=2, nn, s += p; if (isprime(s), my(ss = 0); forprime(q=2, s, ss += q); if (isprime(ss), print1(s, ", "));););} \\ Michel Marcus, Apr 11 2019

Extensions

More terms from Michel Marcus, Apr 11 2019

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

A071148 Partial sums of sequence of odd primes (A065091); a(n) = sum of the first n odd primes.

Original entry on oeis.org

3, 8, 15, 26, 39, 56, 75, 98, 127, 158, 195, 236, 279, 326, 379, 438, 499, 566, 637, 710, 789, 872, 961, 1058, 1159, 1262, 1369, 1478, 1591, 1718, 1849, 1986, 2125, 2274, 2425, 2582, 2745, 2912, 3085, 3264, 3445, 3636, 3829, 4026, 4225, 4436, 4659, 4886
Offset: 1

Views

Author

Labos Elemer, May 13 2002

Keywords

Crossrefs

Programs

  • Maple
    ListTools:-PartialSums(select(isprime, [seq(i,i=3..1000,2)])); # Robert Israel, Feb 12 2017
  • Mathematica
    Accumulate@ Prime@ Range[2, 49] (* Michael De Vlieger, Feb 12 2017 *)
  • PARI
    a(n) = sum(k=1, n+1, prime(k)) - 2; \\ Michel Marcus, Feb 12 2017

Formula

a(n) = A007504(n+1) - 2.

A013916 Numbers k such that the sum of the first k primes is prime.

Original entry on oeis.org

1, 2, 4, 6, 12, 14, 60, 64, 96, 100, 102, 108, 114, 122, 124, 130, 132, 146, 152, 158, 162, 178, 192, 198, 204, 206, 208, 214, 216, 296, 308, 326, 328, 330, 332, 334, 342, 350, 356, 358, 426, 446, 458, 460, 464, 480, 484, 488, 512, 530, 536, 548, 568, 620, 630, 676, 680
Offset: 1

Views

Author

N. J. A. Sloane, Renaud Lifchitz (100637.64(AT)CompuServe.COM)

Keywords

Examples

			6 is a term because the sum of the first six primes 2 + 3 + 5 + 7 + 11 + 13 = 41 is prime.
		

Crossrefs

Programs

  • GAP
    P:=Filtered([1..5300],IsPrime);;
    a:=Filtered([1..Length(P)],n->IsPrime(Sum([1..n],k->P[k])));; Print(a); # Muniru A Asiru, Jan 04 2019
    
  • MATLAB
    p=primes(10000); m=1;
    for u=1:700 ; suma=sum(p(1:u));
         if isprime(suma)==1 ; sol(m)=u; m=m+1; end
    end
    sol; % Marius A. Burtea, Jan 04 2019
    
  • Magma
    [n:n in [1..700] | IsPrime(&+PrimesUpTo(NthPrime(n))) ]; // Marius A. Burtea, Jan 04 2019
    
  • Maple
    p:=proc(n) if isprime(sum(ithprime(k),k=1..n))=true then n else fi end: seq(p(n),n=1..690); # Emeric Deutsch
  • Mathematica
    s = 0; Do[s = s + Prime[n]; If[PrimeQ[s], Print[n]], {n, 1, 1000}]
    Flatten[Position[Accumulate[Prime[Range[2000]]], ?(PrimeQ[#] &)]] (* _Harvey P. Dale, Dec 16 2010 *)
    Flatten[Position[PrimeQ[Accumulate[Prime[Range[2000]]]],True]] (* Fred Patrick Doty, Aug 15 2017 *)
  • PARI
    isA013916(n) = isprime(sum(i=1,n,prime(i))) \\ Michael B. Porter, Jan 29 2010
    
  • Python
    from sympy import isprime, prime
    def aupto(lim):
      s = 0
      for k in range(1, lim+1):
        s += prime(k)
        if isprime(s): print(k, end=", ")
    aupto(680) # Michael S. Branicky, Feb 28 2021

Formula

a(n) = A000720(A013917(n)).

Extensions

More terms from David W. Wilson

A013917 a(n) is prime and sum of all primes <= a(n) is prime.

Original entry on oeis.org

2, 3, 7, 13, 37, 43, 281, 311, 503, 541, 557, 593, 619, 673, 683, 733, 743, 839, 881, 929, 953, 1061, 1163, 1213, 1249, 1277, 1283, 1307, 1321, 1949, 2029, 2161, 2203, 2213, 2237, 2243, 2297, 2357, 2393, 2411, 2957, 3137, 3251, 3257, 3301, 3413, 3461, 3491
Offset: 1

Views

Author

N. J. A. Sloane, Renaud Lifchitz (100637.64(AT)CompuServe.COM)

Keywords

Crossrefs

Programs

Formula

a(n) = A000040(A013916(n)).

Extensions

More terms from David W. Wilson

A098562 Primes that are the sum of the squares of the first k primes for some k.

Original entry on oeis.org

13, 20477, 75997, 239087, 2210983, 3579761, 29194283, 40002073, 45448471, 55600481, 77290091, 108095623, 114986483, 155637463, 226226771, 302920139, 324657881, 519681709, 551321299, 618359839, 797005427, 944007487, 1039681147, 1124764853, 1923614047, 2135308631
Offset: 1

Views

Author

Rick L. Shepherd, Sep 14 2004

Keywords

Comments

These are the primes arising in A098561.

Examples

			From _K. D. Bajpai_, Dec 15 2014: (Start)
13 is in the sequence because the sum of the squares of the first 2 primes is 2^2 + 3^2 = 4 + 9 = 13, which is prime.
20477 is in the sequence because the sum of the squares of the first 18 primes is 2^2 + 3^2 + 5^2 + ... + 59^2 + 61^2 = 4 + 9 + 25 + ... + 3481 + 3721 = 20477, which is prime.
(End)
		

Crossrefs

Cf. A098561 (corresponding n), A024450 (sum of squares of primes), A066525 (sums of cubes of primes), A013918 (sums of primes).
Cf. A000040, A006567. - Jonathan Vos Post, Aug 13 2009

Programs

  • Mathematica
    Select[Table[Sum[Prime[k]^2, {k, 1, n}], {n, 1000}], PrimeQ]  (* K. D. Bajpai, Dec 15 2014 *)
  • PARI
    s=0; forprime(p=2, 1e6, t=s+=p^2; if(isprime(t), print1(t,", "))) \\ K. D. Bajpai, Dec 15 2014

Extensions

a(24)-a(26) from K. D. Bajpai, Dec 15 2014
a(42) in b-file corrected by Andrew Howroyd, Feb 28 2018

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

A071149 Numbers n such that the sum of the first n odd primes (A071148) is prime; analogous to A013916.

Original entry on oeis.org

1, 9, 15, 17, 53, 55, 61, 65, 71, 75, 95, 115, 117, 137, 141, 143, 155, 183, 191, 203, 249, 273, 275, 283, 291, 305, 339, 341, 377, 409, 411, 415, 435, 439, 449, 483, 495, 497, 509, 525, 583, 599, 605, 621, 633, 637, 643, 645, 671, 675, 709, 713, 715, 727
Offset: 1

Views

Author

Labos Elemer, May 13 2002

Keywords

Crossrefs

Programs

Formula

a(n) = pi(A071150(n)). - Charles R Greathouse IV, May 13 2015
Showing 1-10 of 47 results. Next