OFFSET
1,2
MATHEMATICA
hg[n_Integer?Positive] :=hg[n] =hg[n-1] + 2*n*Prime[n]-n^2 hg[1] =0 digits=50 a=Table[hg[n], {n, 1, digits}]
nxt[{n_, a_}]:={n+1, a+2(n+1)Prime[n+1]-(n+1)^2}; NestList[nxt, {1, 0}, 40][[All, 2]] (* Harvey P. Dale, May 01 2017 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Roger L. Bagula, May 19 2004
STATUS
approved