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

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

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

A082277 Smallest prime that is the sum of prime(n) consecutive primes.

Original entry on oeis.org

5, 23, 53, 197, 233, 691, 499, 857, 1151, 2099, 2399, 2909, 3821, 4217, 5107, 6079, 10091, 8273, 12281, 11597, 12713, 15527, 22741, 26041, 25759, 37447, 28087, 36607, 36067, 35527, 42463, 46181, 49279, 65033, 67271, 71011, 71167, 76099, 78139, 96001, 95107
Offset: 1

Views

Author

Cino Hilliard, May 09 2003

Keywords

Examples

			For prime(2) = 3,
2+3+5   = 10,
3+5+7   = 15,
5+7+11  = 23,
7+11+13 = 31.
So a(2) = 23, the first prime that is the sum of 3 consecutive primes.
		

Crossrefs

Cf. A070281.

Programs

  • PARI
    \\ First prime in the sum of a prime number of consecutive primes
    upto(n) = { sr=.2; print1(5", "); forprime(i=2,n, s=0; for(j=1,i, s+=prime(j); ); for(x=1,n, s = s - prime(x)+ prime(x+i); if(isprime(s),sr+=1.0/s; print1(s", "); break); ); ); /* print(); print(sr)*/}
    
  • Python
    from sympy import isprime, nextprime, prime, primerange
    def a(n):
      pn = prime(prime(n))
      smallest = list(primerange(2, pn+1))
      while not isprime(sum(smallest)):
        pn = nextprime(pn)
        smallest = smallest[1:] + [pn]
      return sum(smallest)
    print([a(n) for n in range(1, 42)]) # Michael S. Branicky, May 23 2021

Formula

Sum of reciprocals converges to 0.28053...
a(n) = A070281(prime(n)). - Michel Marcus, Aug 07 2021
Showing 1-3 of 3 results.