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-4 of 4 results.

A070934 Smallest prime equal to the sum of 2n+1 consecutive primes.

Original entry on oeis.org

2, 23, 53, 197, 127, 233, 691, 379, 499, 857, 953, 1151, 1259, 1583, 2099, 2399, 2417, 2579, 2909, 3803, 3821, 4217, 4651, 5107, 5813, 6829, 6079, 6599, 14153, 10091, 8273, 10163, 9521, 12281, 13043, 11597, 12713, 13099, 16763, 15527, 16823, 22741
Offset: 0

Views

Author

Lekraj Beedassy, May 21 2002

Keywords

Examples

			Every term of the increasing sequence of primes 127, 401, 439, 479, 593,... is splittable into a sum of 9 consecutive odd primes and 127 = 3 + 5 + 7 + 11 + 13 + 17 + 19 + 23 + 29 is the least one corresponding to n = 4.
		

Crossrefs

Cf. Bisection of A070281.
See A082244 for another version.

Programs

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

Extensions

Corrected and extended by Ray G. Opao, Aug 26 2004
Entry revised by Ray Chandler, Sep 27 2006

A215235 Least number k such that the sum of the 2n+1 consecutive primes starting with prime(k) is prime.

Original entry on oeis.org

1, 3, 3, 7, 2, 3, 10, 2, 2, 5, 4, 4, 3, 4, 6, 6, 4, 3, 3, 6, 4, 4, 4, 4, 5, 7, 2, 2, 25, 10, 2, 6, 2, 8, 8, 2, 3, 2, 9, 4, 5, 16, 11, 24, 16, 8, 5, 2, 7, 9, 23, 5, 3, 15, 12, 3, 7, 2, 2, 10, 9, 3, 3, 3, 17, 4, 4, 11, 2, 19, 2, 2, 24, 20, 11, 13, 10, 2, 7, 5, 4
Offset: 0

Views

Author

T. D. Noe, Aug 29 2012

Keywords

Comments

The sums are in A070934. The initial primes are in A089793.

Crossrefs

A318351 a(n) is the smallest prime p such that the sum of the first 2*n + 1 odd primes starting with p is prime.

Original entry on oeis.org

3, 5, 5, 17, 3, 5, 29, 3, 3, 11, 7, 7, 5, 7, 13, 13, 7, 5, 5, 13, 7, 7, 7, 7, 11, 17, 3, 3, 97, 29, 3, 13, 3, 19, 19, 3, 5, 3, 23, 7, 11, 53, 31, 89, 53, 19, 11, 3, 17, 23, 83, 11, 5, 47, 37, 5, 17, 3, 3, 29, 23, 5, 5, 5, 59, 7, 7, 31, 3, 67, 3, 3, 89, 71, 31, 41, 29
Offset: 0

Views

Author

David James Sycamore, Aug 24 2018

Keywords

Comments

Conjecture: Sequence is bounded.
The sum of consecutive odd primes is the difference of two terms of A007504, which might be used to find terms for this sequence. - David A. Corneth, Aug 25 2018
Apart from the first term the same as A089793. - R. J. Mathar, Nov 02 2018

Examples

			a(1) = 5 because 3 + 5 + 7 = 15 but 5 + 7 + 11 = 23.
From _David A. Corneth_, Sep 04 2018: (Start)
Partial sums of the primes is sequence A007504; 2, 5, 10, 17, 28, 41, 58, 77, 100, 129, 160, 197, ...
For n = 1, the least k such that A007504(k + 2*n + 1) - A007504(k) is prime is at k = 2 so a(1) is prime(k + 1) = prime(3) = 5.
(End)
		

Crossrefs

Programs

  • Maple
    N:= 100: # to get a(0)..a(N)
    Primes:= [0,seq(ithprime(i),i=2..5/2*N)]:
    PS:= ListTools:-PartialSums(Primes):
    found:= true:
    for n from 0 to 100 while found do
      found:= false;
      for k from 1 to 5/2*N - (2*n+1) do
        if isprime(PS[k+2*n+1]-PS[k]) then
          found:= true; A[n]:= Primes[k+1]; break
        fi
      od
    od:
    seq(A[n],n=0..N); # Robert Israel, Oct 21 2018
  • Mathematica
    Array[Block[{k = 1}, While[! PrimeQ@ Total@ Prime[k + Range[2 # + 1]], k++]; Prime[k + 1]] &, 77, 0] (* Michael De Vlieger, Aug 25 2018 *)
  • PARI
    a(n) = {c = 2*n + 1; t=2; while(!isprime(sum(i = t, t + c - 1, prime(i))), t++); prime(t)} \\ David A. Corneth, Sep 04 2018
    
  • PARI
    upto(n) = {c = n<<1; c += (1-c%2); my(primeSums = List([3]), res = List([3])); t=0; forprime(p = 3, prime(c), t++; listput(primeSums, primeSums[t] + p)); forstep(i = 3, #primeSums, 2, for(j = 1, #primeSums - i,   if(isprime(primeSums[i + j] - primeSums[j]), listput(res,  primeSums[j+1] - primeSums[j]); next(2)))); res} \\ gives at most the first n terms \\ David A. Corneth, Sep 04 2018

A372041 Least prime p such that the sum of squares of the 2n + 1 consecutive primes starting with p is prime, or -1 if no such p exists.

Original entry on oeis.org

3, 3, 5, 3, 3, 5, -1, 5, 5, -1, 3, 7, -1, 3, 13, -1, 5, 5, -1, 7, 23, -1, 13, 5, -1, 7, 5, -1, 59, 29, 3, 3, 5, -1, 3, 5, -1, 13, 11, -1, 37, 23, -1, 43, 11, -1, 3, 5, -1, 11, 5, -1, 5, 19, -1, 5, 43, -1, 13, 29, -1, 7, 19, -1, 41, 47, -1, 13, 11, 3, 7, 5, -1, 29, 7, -1, 79, 13, 3, 3
Offset: 1

Views

Author

Michel Lagneau, Apr 17 2024

Keywords

Comments

a(n) = 2 never occurs, since the sum starting at 2 is always even and >= 4, so not prime.
a(n) = 3 iff n is in A370633 (and equivalently iff 2*n+1 is in A071149).
For n == 1 (mod 3), so 2*n+1 is a multiple of 3, a(n) = 3 or -1, since all primes >= 5 are congruent to 1 (mod 6) so the sum starting at 5 or more is a multiple of 3 and so not prime.

Examples

			a(6) = 5 because 5 is the smallest of 2*6+1 = 13 consecutive primes whose sum of squares = 5^2 + 7^2 + 11^2 + 13^2 + 17^2 + 19^2 + 23^2 + 29^2 + 31^2 + 37^2 + 41^2 + 43^2 + 47^2 = 10453 is prime.
a(7) = -1 because 7 == 1 (mod 3) so its only possibility is that the sum starts at 3, but 3^2 + ... + 53^2 = 13271 is not prime.
		

Crossrefs

Cf. A024450, A089793, A318351, A340771, A370633 (indices of 3's).

Programs

  • PARI
    a(n) = if ((n % 3) == 1, my(vp = primes(2*n+2)); if (isprime(sum(k=2, #vp, vp[k]^2)), return (3), return(-1));); my(vp = primes(2*n+2)); while(! isprime(sum(k=2, #vp, vp[k]^2)), vp = concat(setminus(vp, Set(vp[1])), nextprime(vp[2*n+2]+1))); vp[2]; \\ Michel Marcus, May 16 2024
Showing 1-4 of 4 results.