OFFSET
1,1
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
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
FORMULA
a(n) = prime(1 + n(n-1)/2) + ... + prime(n + n(n-1)/2), where prime(i) is i-th prime.
EXAMPLE
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.
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 *)
PROG
(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
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
EXTENSIONS
More terms from Zak Seidov, Sep 21 2002
STATUS
approved