A024381 a(n) = sum of squares of first n positive integers congruent to 1 mod 4.
1, 26, 107, 276, 565, 1006, 1631, 2472, 3561, 4930, 6611, 8636, 11037, 13846, 17095, 20816, 25041, 29802, 35131, 41060, 47621, 54846, 62767, 71416, 80825, 91026, 102051, 113932, 126701, 140390, 155031, 170656, 187297, 204986, 223755, 243636, 264661
Offset: 1
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).
Programs
-
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
-
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 *)
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