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.

Previous Showing 11-20 of 47 results. Next

A189072 Semiprimes in A007504 (the sum of first n primes).

Original entry on oeis.org

10, 58, 77, 129, 381, 501, 791, 1371, 1851, 2127, 2427, 2747, 3831, 4227, 4661, 6081, 6338, 7141, 7418, 9206, 9523, 11599, 12718, 15537, 20059, 20546, 21037, 26369, 27517, 29897, 34915, 36227, 45434, 47721, 48494, 49281, 50887, 51698, 52519, 54169, 57547
Offset: 1

Views

Author

Zak Seidov, Apr 16 2011

Keywords

Comments

a(n) = A007504(k(n)), values of k(n) = 3, 7, 8, 10, 16, 18, 22, 28, 32, 34, 36, 38, 44, 46, 48, 54, 55, 58, 59, 65, 66, 72, 75, 82, 92, 93, 94, 104, 106, 110, 118, 120, 133, 136, 137, 138, 140, 141, 142, 144, 148, 150, 154, 156, 164, 168, 170, 174, 190, 194, 202, 210, 212, 218, 224, 226, 232, 234, 236, 244, 246, 249, 250, 256, 264, 272, 276, 277, 286, 294, 298, 300.
Intersection of A007504 and A001358. - Robert Israel, Jun 23 2017

Examples

			10 = 2*5 = A007504(3), 58 = 2*29 = A007504(7), 77 = 7*11 = A007504(8).
		

Crossrefs

Cf. A013918 (primes in A007504).

Programs

  • Maple
    PS:= ListTools:-PartialSums(select(isprime, [2,seq(i,i=3..10^4,2)])):
    select(numtheory:-bigomega = 2, PS); # Robert Israel, Jun 23 2017
  • Mathematica
    semiPrimeQ[n_Integer] := Total[FactorInteger[n]][[2]] == 2; Select[Accumulate[Prime[Range[100]]], semiPrimeQ] (* T. D. Noe, Apr 20 2011 *)
    With[{nn=200},Select[Accumulate[Prime[Range[nn]]],PrimeOmega[#]==2&]] (* Harvey P. Dale, Dec 22 2018 *)
  • PARI
    {a=0;s=[];forprime(p=2,10^4,2==bigomega(a=a+p)&s=concat(s,a));s}

A053790 Composite numbers arising as sum of first k primes.

Original entry on oeis.org

10, 28, 58, 77, 100, 129, 160, 238, 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, 5117, 5350, 5589, 5830
Offset: 1

Views

Author

Enoch Haga, Mar 27 2000

Keywords

Comments

Generate sum of first k primes; accept if not prime.

Examples

			a(4) = 77 because 2 + 3 + 5 + 7 + 11 + 13 + 17 + 19 = 77 = A007504(8) is composite, and 77 is the 4th such composite sum of k primes.
		

Crossrefs

Intersection of A002808 and A007504.

Programs

  • Maple
    N:= 10^4: # to use primes <= N
    P:= select(isprime,[2,seq(i,i=3..N,2)]):
    remove(isprime,ListTools:-PartialSums(P)); # Robert Israel, Sep 22 2016
  • Mathematica
    Cases[Accumulate[Prime[Range[100]]],Except[?PrimeQ]] (*_Fred Patrick Doty Aug 22 2017*)
  • PARI
    first(n)=my(v=vector(n),s,i); forprime(p=2,, if(isprime(s+=p), next); v[i++]=s; if(i==n, break)); v \\ Charles R Greathouse IV, Aug 23 2017
    
  • Python
    from sympy import isprime, nextprime
    def aupto(limit):
        alst, s, p = [], 2, 2
        while s < limit:
            if not isprime(s): alst.append(s)
            p = nextprime(p)
            s += p
        return alst
    print(aupto(6000)) # Michael S. Branicky, Oct 28 2021

Formula

{k: A007504(k) in A002808}. - Michael S. Branicky, Oct 28 2021

A071150 Primes p such that the sum of all odd primes <= p is also a prime.

Original entry on oeis.org

3, 29, 53, 61, 251, 263, 293, 317, 359, 383, 503, 641, 647, 787, 821, 827, 911, 1097, 1163, 1249, 1583, 1759, 1783, 1861, 1907, 2017, 2287, 2297, 2593, 2819, 2837, 2861, 3041, 3079, 3181, 3461, 3541, 3557, 3643, 3779, 4259, 4409, 4457, 4597, 4691, 4729, 4789
Offset: 1

Views

Author

Labos Elemer, May 13 2002

Keywords

Examples

			29 is a prime and 3 + 5 + 7 + 11 + 13 + 17 + 19 + 23 + 29 = 127 (also a prime), so 29 is a term. - _Jon E. Schoenfield_, Mar 29 2021
		

Crossrefs

Programs

  • Maple
    SoddP := proc(n)
        option remember;
        if n <= 2 then
            0;
        elif isprime(n) then
            procname(n-1)+n;
        else
            procname(n-1);
        fi ;
    end proc:
    isA071150 := proc(n)
        if isprime(n) and isprime(SoddP(n)) then
            true;
        else
            false;
        end if;
    end proc:
    n := 1 ;
    for i from 3 by 2 do
        if isA071150(i) then
            printf("%d %d\n",n,i) ;
            n := n+1 ;
        end if;
    end do: # R. J. Mathar, Feb 13 2015
  • Mathematica
    Function[s, Select[Array[Take[s, #] &, Length@ s], PrimeQ@ Total@ # &][[All, -1]]]@ Prime@ Range[2, 640] (* Michael De Vlieger, Jul 18 2017 *)
    Module[{nn=650,pr},pr=Prime[Range[2,nn]];Table[If[PrimeQ[Total[Take[ pr, n]]], pr[[n]],Nothing],{n,nn-1}]] (* Harvey P. Dale, May 12 2018 *)
  • Python
    from sympy import isprime, nextprime
    def aupto(limit):
      p, s, alst = 3, 3, []
      while p <= limit:
        if isprime(s): alst.append(p)
        p = nextprime(p)
        s += p
      return alst
    print(aupto(4789)) # Michael S. Branicky, Mar 29 2021

A071151 Primes which are the sum of the first k odd primes for some k.

Original entry on oeis.org

3, 127, 379, 499, 6079, 6599, 8273, 9521, 11597, 13099, 22037, 33623, 34913, 49279, 52517, 54167, 64613, 92951, 101999, 116531, 182107, 222269, 225829, 240379, 255443, 283079, 356387, 360977, 448867, 535669, 541339, 552751, 611953, 624209
Offset: 1

Views

Author

Labos Elemer, May 13 2002

Keywords

Crossrefs

Programs

  • Mathematica
    s=0;lst={};Do[p=Prime[n];s+=p;If[PrimeQ[s],AppendTo[lst,s]],{n,2,7!}];lst (* Vladimir Joseph Stephan Orlovsky, Jan 28 2009 *)
    Select[Accumulate[Prime[Range[2,500]]],PrimeQ]  (* Harvey P. Dale, Mar 14 2011 *)
  • PARI
    list(lim)=my(v=List(),s); forprime(p=3,, if((s+=p)>lim, return(Vec(v))); if(isprime(s), listput(v,s))) \\ Charles R Greathouse IV, May 22 2017
    
  • Python
    from sympy import isprime, nextprime; m = 0; p = 2
    while p < 3100:
        p = nextprime(p); m += p
        if isprime(m): print(m, end = ', ') # Ya-Ping Lu, Dec 24 2024

Extensions

Name simplified by Charles R Greathouse IV, May 22 2017

A053845 Primes of form prime(1) + ... + prime(k) + 1.

Original entry on oeis.org

3, 11, 29, 59, 101, 239, 569, 1061, 1481, 1721, 4889, 5351, 6871, 22549, 23593, 25801, 29297, 35569, 38239, 41023, 71209, 77137, 87517, 94057, 105541, 120349, 122921, 125509, 128113, 133387, 138869, 141677, 156109, 159073, 165041, 183707
Offset: 1

Views

Author

Enoch Haga, Mar 28 2000

Keywords

Examples

			prime(1) + 1 = 2 + 1 = 3 (prime, thus a(1));
prime(1) + prime(2) + 1 = 2 + 3 + 1 = 6 (nonprime);
prime(1) + prime(2) + prime(3) + 1 = 2 + 3 + 5 + 1 = 11 (prime, thus a(2)); etc. - _Jon E. Schoenfield_, Jan 09 2015
		

Crossrefs

Programs

  • Mathematica
    p=1;lst={};Do[p+=Prime[n];If[PrimeQ[p],AppendTo[lst,p]],{n,7!}];lst (* Vladimir Joseph Stephan Orlovsky, Jun 14 2009 *)
  • PARI
    lista(nn) = {s = 1; for (n=1, nn, s += prime(n); if (isprime(s), print1(s, ", ")););} \\ Michel Marcus, Jan 10 2015
  • UBASIC
    10 x=x+1; 20 if x<>prmdiv(x) then 10; 30 y=x; 40 r=r+y; 50 if r=prmdiv(r) then print r;:p=p+1; 60 if p<100 then 10
    

Formula

a(n) = A007504(A089228(n)) + 1. - Amiram Eldar, Apr 29 2024

A070281 Smallest prime which is the sum of n consecutive primes, or 0 if no such prime exists.

Original entry on oeis.org

2, 5, 23, 17, 53, 41, 197, 0, 127, 0, 233, 197, 691, 281, 379, 0, 499, 0, 857, 0, 953, 0, 1151, 0, 1259, 0, 1583, 0, 2099, 0, 2399, 0, 2417, 0, 2579, 0, 2909, 0, 3803, 0, 3821, 0, 4217, 0, 4651, 0, 5107, 0, 5813, 0, 6829, 0, 6079, 0, 6599, 0, 14153, 0, 10091, 7699
Offset: 1

Views

Author

Amarnath Murthy, May 07 2002

Keywords

Comments

Sequence A013918 lists the nonzero numbers occurring at even n.

Examples

			a(60) = 7699 because Sum_{k=1..60} prime(k) = 7699 and 7699 is the smallest possible prime formed by summing 60 consecutive primes. - _Sean A. Irvine_, Jun 07 2024
		

Crossrefs

Cf. A070934.

Programs

  • Mathematica
    f[n_] := Block[{k = 1, s},If[Mod[n, 2] == 0,s = Sum[Prime[i], {i, k, k + n - 1}];If[PrimeQ[s], s, 0],While[s = Sum[Prime[i], {i, k, k + n - 1}] ; ! PrimeQ[s], k++ ];s]];Table[f[n], {n, 65}] (* Ray Chandler, Sep 27 2006 *)

Extensions

Corrected and extended by Jim Nastos, Jun 15 2002
Extended by Ray Chandler, Sep 27 2006
a(60) corrected by Giovanni Resta, May 31 2017
Original a(60) restored by Sean A. Irvine, Jun 07 2024

A154422 Continue with summing & priming the A153089 (level 3) list to level 4.

Original entry on oeis.org

2, 50575480511, 158413287841, 379787123171, 88082548147771, 3939163325960453, 4342203121792903, 41672041797268133, 92013021551247323, 145937058697288751, 157891295660264779, 270930872865589619
Offset: 1

Views

Author

Michael J. Crowe (michaelcrowe117(AT)btinternet.com), Jan 09 2009

Keywords

Comments

See comments in A153089.

Crossrefs

A000040(Level 1),A013918(Level 2),A153089(Level 3),A154423(Level 5),A154424(Level 6)

Programs

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

A197421 Primes of the form Sum_{k=1..n} prime(k)*prime(k+1).

Original entry on oeis.org

44839, 60859, 130411, 204749, 303767, 902971, 1027969, 1471633, 2514257, 3658769, 6908719, 7415743, 21966317, 28168523, 32413109, 37049567, 44034163, 47856331, 373881787, 425445073, 443609813, 564963589, 732111109, 758871401, 857997893, 995046653, 2489902577
Offset: 1

Views

Author

Michel Lagneau, Oct 14 2011

Keywords

Comments

The corresponding values of n are 22, 24, 30, 34, 38, 52, 54, 60, 70, 78, 94, 96, ....

Examples

			For n = 22, a(1) = 44839 = 2*3 + 3*5 + 5*7 + ....+ 79*83 where 79 = prime(22) and 83 = prime(23).
		

Crossrefs

Primes in A074745.
Cf. A013918.

Programs

  • Maple
    p:=0:for n from 1 to 600 do:p:=p+ithprime(n)*ithprime(n+1): if type(p,prime)=true then printf(`%d, `,p): else fi:od:
  • Mathematica
    Select[Table[Sum[Prime[k] Prime[k + 1], {k, n}], {n, 400}], PrimeQ] (* Alonso del Arte, Oct 14 2011 *)
  • PARI
    v=List();t=0;p=2;forprime(q=3,1e4,if(isprime(t+=p*q),listput(v,t));p=q);Vec(v) \\ Charles R Greathouse IV, Oct 14 2011

Extensions

Incorrect a(2243) and beyond removed from b-file by Andrew Howroyd, Feb 27 2018

A364797 Prime powers that are equal to the sum of the first k prime powers (not including 1) for some k.

Original entry on oeis.org

2, 5, 9, 29, 49, 137, 281, 359, 449, 1579, 2029, 2281, 2677, 5519, 12527, 13229, 15451, 17047, 22409, 24389, 25931, 29191, 32687, 42937, 45757, 53239, 56443, 59743, 70201, 81677, 90863, 95087, 101627, 113111, 169343, 200407, 206911, 256049, 302977, 330133, 338707, 356263
Offset: 1

Views

Author

Ilya Gutkovskiy, Aug 08 2023

Keywords

Examples

			49 is a term because 49 is a prime power and 49 = 2 + 3 + 4 + 5 + 7 + 8 + 9 + 11.
		

Crossrefs

Programs

  • Mathematica
    Select[Accumulate[Select[Range[2250], PrimePowerQ]], PrimePowerQ]
  • PARI
    list(lim) = {my(s = 0); for(p = 1, lim, if(isprimepower(p), s += p; if(isprimepower(s), print1(s, ", "))));} \\ Amiram Eldar, Jun 20 2025

A020641 a(n)-th prime is sum of first k primes for some k.

Original entry on oeis.org

1, 3, 7, 13, 45, 60, 977, 1108, 2470, 2687, 2784, 3126, 3470, 3977, 4100, 4511, 4644, 5668, 6148, 6627, 6963, 8407, 9767, 10379, 11007, 11220, 11449, 12111, 12332, 23080, 25001, 28009, 28357, 28709, 29060, 29404, 30824, 32271, 33397, 33764, 47735, 52278
Offset: 1

Views

Author

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

Keywords

Crossrefs

Programs

  • Mathematica
    PrimePi /@ Select[ FoldList[Plus, 0, Prime@ Range@450], PrimeQ@# &] (* Robert G. Wilson v Sep 28 2006 *)
    PrimePi/@Select[Accumulate[Prime[Range[500]]],PrimeQ] (* Harvey P. Dale, Jun 05 2013 *)
Previous Showing 11-20 of 47 results. Next