login
A024381
a(n) = sum of squares of first n positive integers congruent to 1 mod 4.
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,2
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
Sequence in context: A042324 A044277 A044658 * A262756 A262476 A156385
KEYWORD
nonn,easy
STATUS
approved