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.

A007468 Sum of next n primes.

Original entry on oeis.org

2, 8, 31, 88, 199, 384, 659, 1056, 1601, 2310, 3185, 4364, 5693, 7360, 9287, 11494, 14189, 17258, 20517, 24526, 28967, 33736, 38917, 45230, 51797, 59180, 66831, 75582, 84463, 95290, 106255, 117424, 129945, 143334, 158167, 173828, 190013, 207936, 225707, 245724
Offset: 1

Views

Author

Keywords

Comments

If we arrange the prime numbers into a triangle, with 2 at the top, 3 and 5 in the second row, 7, 11 and 13 in the third row, and so on and so forth, this sequence gives the row sums. - Alonso del Arte, Nov 08 2011
In the first 20000 terms, the only perfect square > 1 is 207936 (n=38). Is it the only one? Is there some proof/conjecture? - Carlos Eduardo Olivieri, Mar 09 2015

Examples

			a(1)=2 because "sum of next 1 prime" is 2;
a(2)=8 because sum of next 2 primes is 3+5=8;
a(3)=31 because sum of next 3 primes is 7+11+13=31, etc.
		

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A078721 and A011756 for the starting and ending prime of each sum.

Programs

  • Mathematica
    a[n_] := Sum[Prime[i], {i, 1+n(n-1)/2, n+n(n-1)/2}]; Table[a[n], {n,100}]
    (* Second program: *)
    With[{nn=40},Total/@TakeList[Prime[Range[(nn(nn+1))/2]],Range[nn]]] (* Requires Mathematica version 11 or later *) (* Harvey P. Dale, Jan 15 2020 *)
  • Python
    from sympy import nextprime
    def aupton(terms):
      alst, p = [], 2
      for n in range(1, terms+1):
        s = 0
        for i in range(n):
          s += p
          p = nextprime(p)
        alst.append(s)
      return alst
    print(aupton(40)) # Michael S. Branicky, Feb 08 2021

Formula

a(n) = prime(1 + n(n-1)/2) + ... + prime(n + n(n-1)/2), where prime(i) is i-th prime.

Extensions

More terms from Zak Seidov, Sep 21 2002