OFFSET
1,2
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (4,-6,4,-1).
FORMULA
1^2 + 5^2 + 9^2 + ... + (4n+1)^2 = (4n+1)(n+1)+(4^2)(2n+1)(n+1)n/6, which generalizes to (0a+1)^2 + (1a+1)^2 + (2a+1)^2 + ... + (na+1)^2 = (an+1)(n+1) + (a^2)(2n+1)(n+1)n/6. Also Sum{n}_(an+1)^2 = (an+1)(n+1) + (a^2)* sum{n}_(n+1)^2. - Helmut Rasinger (helmut.rasinger(AT)wanadoo.fr), Sep 04 2003
G.f.: x*(1 + 22*x + 9*x^2) / (x-1)^4. - R. J. Mathar, Oct 08 2011
a(n) = 4*a(n-1) - 6*a(n-2) + 4*a(n-3) - a(n-4). - Vincenzo Librandi, Jun 19 2012
MATHEMATICA
LinearRecurrence[{4, -6, 4, -1}, {1, 26, 107, 276}, 40] (* Vincenzo Librandi, Jun 19 2012 *)
Accumulate[Range[1, 151, 4]^2] (* Harvey P. Dale, Apr 25 2020 *)
PROG
(Magma) I:=[1, 26, 107, 276]; [n le 4 select I[n] else 4*Self(n-1)-6*Self(n-2)+4*Self(n-3)-Self(n-4): n in [1..40]]; // Vincenzo Librandi, Jun 19 2012
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved