OFFSET
1,1
LINKS
Paolo Xausa, Table of n, a(n) for n = 1..1000
FORMULA
a(n) ~ x^2/(2*log(x)-1), where x = prime(n*(n-1)/2+n). For n = 10000, the relative error is about 0.06%.
EXAMPLE
The consecutive primes 2, 3, 5, 7, 11, 13 form the triangular grid
2
3 5
7 11 13
These consecutive primes add up to 41, the third entry in the table.
MATHEMATICA
With[{nmax = 50}, Accumulate[Prime[Range[PolygonalNumber[nmax]]]][[PolygonalNumber[Range[nmax]]]]] (* Paolo Xausa, May 15 2025 *)
PROG
(PARI) a(n) = sum(x=1, n*(n+1)/2, prime(x))
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Cino Hilliard, Jan 10 2007
STATUS
approved
