OFFSET
1,1
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..5000
FORMULA
a(1) = 2; a(n) = a(n-1) + n^2 + 1 for n > 1.
From Christoph Pacher (christoph.pacher(AT)ait.ac.at), Jul 23 2010: (Start)
a(n) = Sum_{k=1..n} (k^2 + 1).
a(n) = A000330(n) + n.
a(n) = n*(n+1)*(2*n+1)/6 + n. (End)
G.f.: x*(2-x+x^2)/(1-x)^4. - Colin Barker, Apr 04 2012
E.g.f.: (1/6)*x*(12 + 9*x + 2*x^2)*exp(x). - G. C. Greubel, Jul 22 2017
a(n) = A081489(n+1) - 1. - Jianing Song, Oct 10 2021
EXAMPLE
a(2) = a(1) + 2^2 + 1 = 2 + 4 + 1 = 7; a(3) = a(2) + 3^2 + 1 = 7 + 9 + 1 = 17.
MATHEMATICA
Accumulate[Range[50]^2+1] (* Harvey P. Dale, Dec 07 2016 *)
PROG
(PARI) {a=0; for(n=1, 42, print1(a=a+n^2+1, ", "))}
(Python)
def A145066(n): return (n*(n*(2*n + 3) + 1))//6 + n # Chai Wah Wu, Oct 30 2024
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Vladimir Joseph Stephan Orlovsky, Sep 30 2008
EXTENSIONS
Edited by Klaus Brockhaus, Oct 17 2008
STATUS
approved