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

A098563 Numbers n such that the sum of the cubes of the first n primes is prime.

Original entry on oeis.org

4, 8, 38, 48, 98, 102, 118, 128, 130, 132, 156, 168, 172, 178, 180, 190, 202, 208, 308, 346, 358, 364, 424, 482, 540, 600, 602, 614, 646, 676, 722, 748, 768, 776, 782, 792, 838, 902, 1016, 1028, 1036, 1058, 1062, 1082, 1086, 1100, 1102, 1132, 1144, 1176
Offset: 1

Views

Author

Rick L. Shepherd, Sep 14 2004

Keywords

Comments

n must clearly be even.

Examples

			4 is a term as the sum of the cubes of the first four primes is 2^3 + 3^3 + 5^3 + 7^3 = 503, which is prime.
		

Crossrefs

Cf. A066525 (corresponding primes), A098561 (sums of squares of primes), A013916 (sums of primes), A098999 (sums of cubes of primes).

Programs

  • Maple
    with(numtheory): P:=proc(n) add(ithprime(k)^3, k=1..n): end:
    A098563 := proc(n)local m: option remember: if(n=0)then return 0: fi: m:=procname(n-1)+2: while true do if(isprime(P(m)))then return m:fi: m:=m+2:od: end:
    seq(A098563(n), n=1..50); # Nathaniel Johnston, Apr 21 2011
  • Mathematica
    Select[Range[1000], PrimeQ[Sum[Prime[i]^3, {i, #}]] &] (* Carl Najafi, Aug 22 2011 *)
  • PARI
    lista(nn) = {s = 0; ip = 0; forprime (p=1, nn, ip++; if (isprime(s+=p^3), print1(ip, ", ")););} \\ Michel Marcus, Aug 22 2015

A007610 Sum of n consecutive primes starting at a(n) is prime (or 0 if impossible).

Original entry on oeis.org

2, 2, 5, 2, 5, 2, 17, 0, 3, 0, 5, 2, 29, 2, 3, 0, 3, 0, 11, 0, 7, 0, 7, 0, 5, 0, 7, 0, 13, 0, 13, 0, 7, 0, 5, 0, 5, 0, 13, 0, 7, 0, 7, 0, 7, 0, 7, 0, 11, 0, 17, 0, 3, 0, 3, 0, 97, 0, 29, 2, 3, 0, 13, 2, 3, 0, 19, 0, 19, 0, 3, 0, 5, 0, 3, 0, 23, 0, 7, 0, 11, 0, 53, 0, 31, 0, 89, 0, 53, 0, 19, 0, 11, 0, 3, 2
Offset: 1

Views

Author

Keywords

Comments

a(n) = 0 iff n is even and the sum of 2..P(n) is not prime. See A013916. - Robert G. Wilson v, Feb 16 2002

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • C. W. Trigg, Prime sums of consecutive primes, J. Rec. Math., 18 (No. 4, 1985-1986), 247-248.

Crossrefs

Programs

  • Mathematica
    f[n_] := If[OddQ@ n, Block[{k = 1}, While[ !PrimeQ[Plus @@ Prime[Range[k, k + n - 1]]], k++]; Prime@ k], If[ PrimeQ[Plus @@ Prime@ Range@ n], 2, 0]]; Array[f, 96] (* Robert G. Wilson v, May 11 2015 *)

A046280 Numbers k such that the sum of the first k lucky numbers, A046279(k), is prime.

Original entry on oeis.org

3, 15, 25, 31, 37, 55, 57, 85, 91, 99, 133, 153, 173, 179, 183, 219, 293, 301, 305, 353, 355, 383, 387, 389, 393, 397, 403, 407, 409, 427, 453, 467, 491, 495, 515, 517, 519, 547, 573, 681, 691, 703, 705, 723, 731, 733, 747, 761, 795, 829, 837, 845, 865, 873
Offset: 1

Views

Author

Patrick De Geest, Jun 15 1998

Keywords

Crossrefs

Extensions

Offset corrected by Amiram Eldar, Nov 16 2019

A102863 a(n)=1 if at least one of the first n primes is a divisor of the sum of the first n primes; otherwise a(n)=0.

Original entry on oeis.org

1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1
Offset: 1

Views

Author

Giovanni Teofilatto, Mar 01 2005

Keywords

Comments

a(n) = 0 if and only if n is in A013916. - Robert Israel, Jan 04 2017

Examples

			a(2)=0 because none of the first 2 primes (2, 3) is a divisor of 2+3; a(5)=1 because among the first 5 primes (namely, 2,3,5,7,11) there are divisors of 2+3+5+7+11=28.
		

Crossrefs

A105783(n) gives number of primes among the first n primes that are divisors of the sum of the first n primes.

Programs

  • Maple
    with(numtheory):
    a:=proc(n)
       if nops(factorset(sum(ithprime(k),k=1..n)) intersect {seq(ithprime(j),j=1..n)}) >0 then
          1
       else
          0
       fi
    end:
    seq(a(n),n=1..130); # Emeric Deutsch
    # alternative:
    N:= 500: # to get the first N terms
    A:= Vector(N):
    S:= 2: P:= 2: p:= 2: A[1]:= 1:
    for n from 2 to N do
      p:= nextprime(p);
      S:= S+p; P:= P*p;
      if igcd(S,P) > 1 then A[n]:= 1 fi
    od:
    convert(A,list); # Robert Israel, Jan 04 2017
  • Mathematica
    a[n_] := Module[{pp = Prime[Range[n]], t}, t = Total[pp]; Boole[AnyTrue[pp, Divisible[t, #]&]]];
    Array[a, 100] (* Jean-François Alcover, Jun 16 2020 *)

Extensions

Edited and extended by Emeric Deutsch, Apr 19 2005

A124225 Numbers n such that the sum of the first n primes is prime and the sum of the squares of the first n primes is also prime.

Original entry on oeis.org

2, 158, 192, 216, 356, 426, 548, 680, 1178, 1196, 1466, 1500, 1524, 2324, 2438, 2904, 2990, 3060, 3146, 3618, 3902, 4110, 4134, 4346, 4602, 5790, 5840, 6186, 6344, 6710, 6720, 6836, 6990, 7592, 7632, 7716, 7790, 7838, 8156, 8420, 8622, 8658, 8664, 9092
Offset: 1

Views

Author

Tanya Khovanova, Dec 13 2006

Keywords

Crossrefs

Intersection of A098561 (Numbers n such that the sum of the squares of the first n primes is prime) and A013916 (Numbers n such that the sum of the first n primes is prime).

Programs

Extensions

More terms from Bruno Berselli, Dec 28 2011
Definition rephrased by Harvey P. Dale, Aug 18 2020

A213650 Numbers k such that the sum of the first k primes is semiprime.

Original entry on oeis.org

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
Offset: 1

Views

Author

Michel Lagneau, Jun 17 2012

Keywords

Comments

Numbers k such that A007504(k) is included in A001358.

Examples

			8 is in the sequence because the sum of the first 8 primes is  2 + 3 + 5 + 7 + 11 + 13 + 17 + 19 = 77 = 7*11, which is semiprime.
		

Crossrefs

Cf. A001358, A007504, A013916, A092189 (numbers n such that sum of first n semiprimes is a semiprime), A092190 (semiprimes that are the sum of first n semiprimes for some n), A180152 (numbers n such that the sum of the first n semiprimes is a prime).

Programs

  • Maple
    with(numtheory): for n from 1 to 500 do:s:=sum(‘ithprime(k)’, ’k’=1..n):if bigomega(s)=2 then printf(`%d, `, n):else fi:od:
  • Mathematica
    Flatten[Position[Accumulate[Prime[Range[300]]],_?(PrimeOmega[#]==2&)]]
  • PARI
    isok(n) = bigomega(vecsum(primes(n))) == 2; \\ Michel Marcus, Sep 18 2017

A321342 Numbers k such that if j is the sum of the first k primes, then the sum of the first j primes is prime.

Original entry on oeis.org

1, 9, 15, 19, 73, 85, 87, 103, 121, 157, 175, 277, 313, 317, 341, 357, 375, 385, 391, 421, 443, 447, 523, 525, 539, 571, 607, 611, 645, 701, 779, 783, 791, 799, 823, 831, 835, 853, 889, 907, 911, 925, 977, 1051, 1075, 1081, 1087, 1095, 1117, 1125, 1135, 1157, 1181, 1187, 1223, 1257, 1305, 1325
Offset: 1

Views

Author

David James Sycamore, Nov 06 2018

Keywords

Comments

k is in the sequence if A007504(j) is prime, where j = A007504(k). A007504(j) must be odd to be prime, so j must be even and k must be odd. Therefore all terms are odd. The subsequence of primes is A321343.

Examples

			A007504(1) = 2 and A007504(2) = 5, a prime therefore 1 is a term.
A007504(3) = 10 and A007504(10) = 129, not prime, therefore 3 is not a term.
A007504(9) = 100 and A007504(100) = 24133, a prime so 9 is a term.
		

Crossrefs

Programs

  • Maple
    N:=2000:
    for n from 1 to N by 2 do
    X:=add(ithprime(r),r=1..n);
    Y:=add(ithprime(k),k=1..X);
    if isprime(Y) then print(n);
    end if:
    end do:
  • Mathematica
    primeSum[n_] := Sum[Prime[i], {i, n}]; Select[Range[300], PrimeQ[primeSum[primeSum[#]]] &] (* Amiram Eldar, Nov 07 2018 *)
  • PARI
    sfp(n) = sum(k=1, n, prime(k)); \\ A007504
    isok(n) = isprime(sfp(sfp(n))); \\ Michel Marcus, Nov 08 2018

A321343 Primes p such that if k is the sum of the first p primes then the sum of the first k primes is prime.

Original entry on oeis.org

19, 73, 103, 157, 277, 313, 317, 421, 443, 523, 571, 607, 701, 823, 853, 907, 911, 977, 1051, 1087, 1117, 1181, 1187, 1223, 1451, 1453, 1531, 1667, 1861, 2551, 2999, 3169, 3257, 3389, 3583, 3671, 3889, 3907, 3911, 4597, 4691, 4919, 5347, 5527, 5569, 5623, 5657, 5839
Offset: 1

Views

Author

David James Sycamore, Nov 06 2018

Keywords

Comments

Primes p such that A007504(A007504(p)) is prime; subsequence of A321342.

Examples

			The smallest prime p such that A007504(p) is prime is 19 (sum of first 19 primes is 100 and sum of first 100 primes is 24133, which is prime). Therefore a(1) = 19.
		

Crossrefs

Programs

  • Maple
    N:=2000:
    for n from 1 to N by 2 do
    X:=add(ithprime(k),k=1..n);
    Y:=add(ithprime(j),j=1..X);
    if isprime(n)and isprime(Y) then print(n);
    end if:
    end do:
  • Mathematica
    primeSum[n_] := Sum[Prime[i], {i, n}]; Select[Range[300], PrimeQ[#] && PrimeQ[primeSum[primeSum[#]]] &] (* Amiram Eldar, Nov 07 2018 *)
  • PARI
    upto(n) = {my(v = vector(n+1), res = List, t = 1, setv, s = 0, Ap = 0, AAp=0, q =0); v[1] = 2; forprime(p = 3, prime(n+1), t++; v[t] = v[t-1] + p); t=1; vt = v[1]; forprime(p = 2, , AAp += p; q++; if(q == vt, if(isprime(t) && isprime(AAp), listput(res, t); print1(t", ")); t++; if(t>=n, return(res)); vt = v[t])); res} \\ David A. Corneth, Nov 09 2018
    
  • Perl
    use ntheory qw(:all);
    for (my ($i, $k) = (1, 1); ; ++$k) {
        my $p = nth_prime($k);
        if (is_prime sum_primes nth_prime sum_primes nth_prime $p) {
            print "a($i) = $p\n"; ++$i;
        }
    } # Daniel Suteu, Nov 11 2018

A366092 Distance from the sum of the first n primes to the nearest prime.

Original entry on oeis.org

2, 0, 0, 1, 0, 1, 0, 1, 2, 1, 2, 3, 0, 1, 0, 3, 2, 1, 2, 1, 2, 3, 4, 3, 4, 1, 2, 5, 2, 1, 4, 1, 4, 1, 2, 3, 4, 5, 2, 3, 2, 5, 2, 1, 2, 1, 2, 3, 2, 1, 2, 1, 2, 3, 2, 1, 2, 1, 10, 1, 0, 11, 2, 1, 0, 3, 2, 3, 2, 7, 2, 1, 2, 3, 4, 3, 2, 3, 4, 5, 2, 5, 4, 3, 10, 3
Offset: 0

Views

Author

Paolo Xausa, Sep 29 2023

Keywords

Comments

Positions of zeros are given by A013916.
Positions of records are given by A366093.

Examples

			a(3) = 1 because the sum of the first 3 primes is 2 + 3 + 5 = 10, the nearest prime is 11 and 11 - 10 = 1.
		

Crossrefs

Programs

  • Mathematica
    pDist[n_]:=If[PrimeQ[n],0,Min[NextPrime[n]-n,n-NextPrime[n,-1]]];
    A366092list[nmax_]:=Map[pDist,Prepend[Accumulate[Prime[Range[nmax]]],0]];
    A366092list[100]
  • Python
    from sympy import prime, nextprime, prevprime
    def A366092(n): return min((m:=sum(prime(i) for i in range(1,n+1)))-prevprime(m+1),nextprime(m)-m) if n else 2 # Chai Wah Wu, Oct 03 2023

Formula

a(n) = A051699(A007504(n)).
a(n) = abs(A007504(n) - A366094(n)).

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