A007468 Sum of next n primes.
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
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).
Links
- T. D. Noe, Table of n, a(n) for n = 1..1000
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
Comments