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 31-38 of 38 results.

A235431 The smallest positive number that must be added to or subtracted from the sum of the first n primes in order to get a prime.

Original entry on oeis.org

1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 1, 2, 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, 4, 11, 2, 1, 6
Offset: 1

Views

Author

R. J. Cano, Jan 17 2014

Keywords

Comments

The primes in A013918 would have associated a(n)=0 if not for the qualifier "positive" in the definition.
The sum of the first n primes appears to be close to a prime. For illustration, the maximum for a(n) among the first 5 million terms is a(808500) = 218.
See A013916 for the above mentioned indices, numbers n such that the sum of the first n primes is prime. - M. F. Hasler, Jan 20 2014

Examples

			The sum of the first 9 primes is 100, and by adding 1 we get 101. Since 101 is a prime, a(9) = 1.
The sum of the first 10 primes is 129, since 129 - 2 = prime(31) = 127 or 129 + 2 = prime(32) = 131, a(10) = 2.
The sum of the first 129 primes minus 1 is a prime, this is 42468 - 1 = prime(4443), so a(129) = 1.
		

Crossrefs

Programs

  • PARI
    a(n)=my(u=sum(j=1,n,prime(j)),k=1);while(!(isprime(u+k)||isprime(u-k)),k++);k

Formula

Algorithm:
Let S be the sum of the first n primes;
initially, let k=1;
increment k while neither S-k nor S+k is prime;
return a(n)=k.
a(n) = min(A013632(A007504(n)), A049711(A007504(n))). - M. F. Hasler, Jan 20 2014

A270563 Integers k such that A086167(k) and A086168(k) are both prime.

Original entry on oeis.org

1, 15, 45, 105, 135, 231, 807, 1215, 1329, 1395, 1593, 1911, 2301, 2331, 2493, 3045, 3267, 3417, 3495, 3897, 4029, 4059, 4359, 4377, 4635, 4665, 4731, 5265, 6135, 6315, 6429, 6489, 6795, 6915, 6999, 7329, 7515, 7965, 8469, 8979, 9183, 9441, 10755, 11193, 12039
Offset: 1

Views

Author

Altug Alkan, Mar 19 2016

Keywords

Comments

A013916 lists numbers n such that the sum of the first n primes is prime. With similar motivation, twin prime pairs generate prime pairs in this sequence. Note that 2*n also gives the difference between members of prime pair that is generated by sum of first n twin prime pairs.
First differences of this sequence are 14, 30, 60, 30, 96, 576, ...

Examples

			15 is a term since A086167(15) = 1297 and A086168(15) = 1297 + 15*2 = 1327. 1297 and 1327 are both prime.
		

Crossrefs

Programs

  • Mathematica
    seq = {}; s1 = s2 = 0; c = n = 0; p = prv = 2; While[c < 45, p = NextPrime[p]; If[p == prv + 2, n++; s1 += prv; s2 += p; If[PrimeQ[s1] && PrimeQ[s2], c++; AppendTo[seq, n]]]; prv = p]; seq (* Amiram Eldar, Jan 03 2020 *)
  • PARI
    t(n, p=3) = {while( p+2 < (p=nextprime( p+1 )) || n-->0, ); p-2}
    s1(n) = sum(k=1, n, t(k));
    s2(n) = sum(k=1, n, t(k)+2);
    for(n=1, 1e3, if(ispseudoprime(s1(n)) && ispseudoprime(s2(n)), print1(n, ", ")));

Extensions

More terms from Amiram Eldar, Jan 03 2020

A277123 Numbers k such that 1 + Sum_{j=1..k} prime(j)^2 is prime.

Original entry on oeis.org

1, 11, 19, 29, 37, 73, 97, 155, 163, 175, 191, 257, 295, 313, 325, 341, 365, 389, 391, 409, 415, 461, 491, 497, 515, 599, 697, 715, 757, 761, 767, 775, 785, 793, 857, 875, 895, 899, 905, 919, 1099, 1109, 1117, 1139, 1151, 1163, 1225, 1271, 1279, 1295, 1309
Offset: 1

Views

Author

Alex Ratushnyak, Sep 30 2016

Keywords

Crossrefs

Programs

  • Mathematica
    Position[Accumulate[Prime[Range[2000]]^2]+1,?PrimeQ]//Flatten (* _Harvey P. Dale, Sep 07 2019 *)
  • PARI
    lista(nn) = for(n=1, nn, if(isprime(1+sum(i=1, n, prime(i)^2)), print1(n, ", "))); \\ Altug Alkan, Oct 01 2016
  • Python
    import sympy
    sum = p = 1
    for n in range(1,3001):
      while not sympy.isprime(p):  p+=1    # find the n'th prime
      sum += p*p
      p+=1
      if sympy.isprime(sum):  print(n, end=', ')
    

A280536 Numbers n such that the sum of the first n primes reduced by some power of 2 is prime.

Original entry on oeis.org

2, 3, 4, 5, 6, 7, 11, 12, 14, 15, 19, 21, 27, 35, 55, 59, 60, 64, 65, 75, 81, 83, 93, 95, 96, 100, 102, 108, 109, 114, 122, 124, 130, 132, 133, 135, 137, 141, 146, 152, 155, 158, 162, 165, 171, 178, 183, 192, 193, 198, 204, 206, 208, 214, 216, 223, 227, 243, 249, 255, 257, 263, 277, 279, 296
Offset: 1

Views

Author

Robert G. Wilson v, Jan 04 2017

Keywords

Comments

A013916 except for the first term, 1, is a proper subset.
The odd terms are: 3, 5, 7, 11, 15, 19, 21, 27, 35, 55, 59, 65, 75, 81, 83, ..., .
The 10^k-th term: 2, 15, 469, 7980, 110374, 1359497, 16214466, 187663922, ..., .

Examples

			11 is in the sequence since the sum of the first 11 primes is A007504(11) = 160 and 160 is divisible by 2^5 which gives 5, a prime.
		

Crossrefs

Programs

  • Mathematica
    fQ[n_] := Block[{s = Sum[ Prime@ k, {k, n}]}, PrimeQ[s/2^IntegerExponent[s, 2]]]; Select[Range@300, fQ]

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

A309718 Numbers k such that the sums of the first k and k+2 primes are also prime.

Original entry on oeis.org

2, 4, 12, 100, 122, 130, 204, 206, 214, 326, 328, 330, 332, 356, 458, 1024, 1148, 1190, 1418, 1474, 1476, 1500, 1524, 1630, 1842, 1948, 2128, 2130, 2184, 2436, 2448, 2536, 2686, 2688, 2784, 2796, 2898, 2980, 3112, 3562, 3682, 3806, 3936, 3944, 4114, 4318, 4332, 4364, 4376, 4412
Offset: 1

Views

Author

Philip Mizzi, Aug 13 2019

Keywords

Comments

The first run of four consecutive terms that differ by two, starts at k = 326.
The first run of five consecutive terms that differ by two, starts at k = 1195374. - Daniel Suteu, Aug 17 2019

Examples

			For k=2, the sum of the first two primes 2+3 = 5 is prime. Additionally, the sum of the first k + 2=4 primes 2+3+5+7 = 17 is prime. So 2 is a term.
For k=6, the sum of the first six primes 2+3+5+7+11+13 = 41 is prime. But, the sum of the first k+2=8 primes 2+3+5+7+11+13+17+19 = 77 is not a prime. So 6 is not a term.
		

Crossrefs

Cf. A013916.

Programs

  • Maple
    P:= [seq(ithprime(i),i=1..10002)]:
    S:= ListTools:-PartialSums(P):
    select(k -> isprime(S[k]) and isprime(S[k+2]),2*[$1..5000]); # Robert Israel, Sep 01 2019
  • PARI
    isspp(n) = isprime(sum(i=1, n, prime(i))); \\ A013916
    isok(n) = isspp(n) && isspp(n+2); \\ Michel Marcus, Aug 14 2019

Extensions

More terms from Michel Marcus, Aug 14 2019

A329539 Numbers m such that the sum of the first m primes as well as the sum of the squares and the sum of the cubes of the first m primes are all prime.

Original entry on oeis.org

3618, 5840, 7716, 17502, 19460, 22398, 23520, 26852, 33824, 41202, 45848, 47328, 62138, 72950, 82722, 101084, 118062, 127160, 128784, 134012, 136380, 148940, 165240, 173658, 175220, 175310, 177516, 187556, 193692, 203310, 230802, 234032, 279102, 281754, 285518, 289970, 295196, 298652
Offset: 1

Views

Author

Michel Marcus, Nov 16 2019

Keywords

Crossrefs

Programs

  • Mathematica
    Module[{nn=300000,prs,m1,m2,m3},prs=Prime[Range[nn]];m1=Accumulate[ prs];m2 = Accumulate[prs^2];m3=Accumulate[prs^3];Position[Thread[ {m1,m2,m3}],? (Total[ Boole[ PrimeQ[#]]]==3&)]]//Flatten (* _Harvey P. Dale, Jul 28 2021 *)
  • PARI
    s=0; t=0; u=0; n=0; forprime(p=2, 1e6, s+=p; t+=p^2; u+=p^3; n++; if(isprime(u) && isprime(t) && isprime(s), print1(n, ", ")))

Extensions

Name (description) modified by Harvey P. Dale, Jul 28 2021

A287748 If A070281(n) is not 0, then a(n) is index of the starting primes for form A070281(n), or a(n) = 0 if A070281(n) = 0.

Original entry on oeis.org

1, 2, 3, 2, 3, 2, 7, 0, 2, 0, 3, 2, 10, 2, 2, 0, 2, 0, 5, 0, 4, 0, 4, 0, 3, 0, 4, 0, 6, 0, 6, 0, 4, 0, 3, 0, 3, 0, 6, 0, 4, 0, 4, 0, 4, 0, 4, 0, 5, 0, 7, 0, 2, 0, 2, 0, 25, 0, 10, 2, 2, 0, 6, 2, 2, 0, 8, 0, 8, 0, 2, 0, 3, 0, 2, 0, 9, 0, 4, 0, 5, 0, 16, 0, 11
Offset: 1

Views

Author

XU Pingya, May 31 2017

Keywords

Examples

			A070281(13) = 691 = prime(10) + ... + prime(22), thus a(13) = 10.
		

Crossrefs

Previous Showing 31-38 of 38 results.