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 11 results. Next

A255017 Intersection of A013917 and A071150.

Original entry on oeis.org

3, 503, 1163, 1249, 2297, 3461, 5051, 6563, 9001, 9649, 9689, 11197, 16843, 20233, 22279, 25237, 26681, 27329, 28607, 28669, 29131, 36791, 41507, 49741, 55807, 57697, 59021, 61493, 62731, 64453, 64879, 65129, 68371, 69493, 70619, 70969, 71161, 77893, 79063, 79531, 79801
Offset: 1

Views

Author

Robert G. Wilson v, Feb 12 2015

Keywords

Comments

For these primes, the corresponding term s=A013918(k) and s-2 are twin primes. - Michel Marcus, Feb 23 2015

Crossrefs

Programs

  • PARI
    lista(nn) = {s = 0; forprime(p=2, nn, s += p; if (isprime(s) && isprime(s-2), print1(p, ", ")););} \\ Michel Marcus, Feb 23 2015

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

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.

A013918 Primes equal to the sum of the first k primes for some k.

Original entry on oeis.org

2, 5, 17, 41, 197, 281, 7699, 8893, 22039, 24133, 25237, 28697, 32353, 37561, 38921, 43201, 44683, 55837, 61027, 66463, 70241, 86453, 102001, 109147, 116533, 119069, 121631, 129419, 132059, 263171, 287137, 325019, 329401, 333821, 338279, 342761
Offset: 1

Views

Author

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

Keywords

Comments

Intersection of A000040 and A007504. - David W. Wilson, May 11 2007
Sum of the first k primes p_1+p_2+...+p_k is in the sequence if and only if there exists the prime q for which p_i divides p_1+p_2+...+p_k+q for all i to k. - Vladimir Letsko, Oct 13 2013

Crossrefs

Cf. A013916, A013917, A189153 (number of these primes < 10^n).

Programs

  • Haskell
    a013918 n = a013918_list !! (n-1)
    a013918_list = filter ((== 1) . a010051) a007504_list
    -- Reinhard Zumkeller, Feb 09 2015
    
  • Mathematica
    Select[Accumulate[Prime[Range[1000]]], PrimeQ] (* Vladimir Joseph Stephan Orlovsky, Sep 01 2008 *)
  • PARI
    n=0;forprime(k=2,2300,n=n+k;if(isprime(n),print(n))) \\ Michael B. Porter, Jan 29 2010
    
  • Python
    from sympy import isprime, nextprime; m = p = 0
    while p < 2280:
        p = nextprime(p); m += p
        if isprime(m): print(m, end = ', ') # Ya-Ping Lu, Dec 24 2024

Formula

a(n) = A007504(A013916(n)).

Extensions

More terms from David W. Wilson

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

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

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

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 *)

A046283 Lucky numbers k such that the sum of the lucky numbers <= k is prime.

Original entry on oeis.org

3, 15, 25, 31, 37, 99, 133, 219, 393, 409, 427, 495, 517, 519, 723, 873, 883, 885, 903, 979, 1219, 1251, 1291, 1357, 1387, 1389, 1435, 1459, 1543, 1575, 1693, 1777, 1921, 1965, 1977, 1983, 1995, 2211, 2281, 2301, 2335, 2343, 2355, 2445, 2649, 2815, 3003
Offset: 1

Views

Author

Patrick De Geest, Jun 15 1998

Keywords

Crossrefs

Extensions

Offset corrected by Amiram Eldar, Nov 16 2019

A282246 Primes p such that the sum of all primes <= p has no prime divisor > p.

Original entry on oeis.org

2, 5, 11, 19, 23, 31, 41, 47, 59, 71, 83, 97, 101, 103, 109, 113, 127, 137, 157, 163, 167, 173, 179, 191, 197, 223, 227, 229, 233, 239, 241, 263, 269, 271, 317, 337, 349, 353, 367, 389, 401, 409, 433, 439, 449, 457, 461, 463, 467, 491, 521, 563, 571, 607, 613, 617, 631, 641, 653, 661, 701, 709, 719, 739, 757, 797
Offset: 1

Views

Author

Emmanuel Vantieghem, Feb 09 2017

Keywords

Comments

Number of terms < 10^k: 2, 12, 79, 523, 4124, 32678, 267850, etc. Compare these to A006880. - Robert G. Wilson v, Feb 09 2017
Primes p such that A006530(A007504(i)) <= p, where i is the index of p in A000040. - Felix Fröhlich, Feb 12 2017

Examples

			5 is in the sequence for the sum of all primes <= 5 is 10, and 10 has no prime divisor > 5.
17 is not in the sequence for the corresponding sum is 58 which has a prime divisor > 17.
		

Crossrefs

Programs

  • Mathematica
    p = s = 2; lst = {}; While[p < 1000, If[ FactorInteger[s][[-1, 1]] <= p, AppendTo[lst, p]]; p = NextPrime@ p; s = s + p]; lst (* Robert G. Wilson v, Feb 09 2017 *)
  • PARI
    isok(n) = isprime(n) && (vecmax(factor(sum(k=1, primepi(n), prime(k)))[,1]) <= n); \\ Michel Marcus, Feb 12 2017
Showing 1-10 of 11 results. Next