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.

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