A098077 a(n) = n^2*(n+1)*(2*n+1)/3.
2, 20, 84, 240, 550, 1092, 1960, 3264, 5130, 7700, 11132, 15600, 21294, 28420, 37200, 47872, 60690, 75924, 93860, 114800, 139062, 166980, 198904, 235200, 276250, 322452, 374220, 431984, 496190, 567300, 645792, 732160, 826914, 930580, 1043700
Offset: 1
Examples
a(2) = (1^2 + 1^2) + (1^2 + 2^2) + (2^2 + 1^2) + (2^2 + 2^2) = 2 + 5 + 5 + 8 = 20.
Links
- Vincenzo Librandi, Table of n, a(n) for n = 1..1000
- Index entries for linear recurrences with constant coefficients, signature (5,-10,10,-5,1).
Programs
-
Magma
[n^2*(n+1)*(2*n+1)/3: n in [1..40]]; // G. C. Greubel, Apr 09 2023
-
Mathematica
Table[ Sum[i^2 + j^2, {i, n}, {j, n}], {n, 35}] LinearRecurrence[{5, -10, 10, -5, 1}, {2, 20, 84, 240, 550}, 40] (* Vincenzo Librandi, Apr 16 2018 *)
-
PARI
a(n)=n^2*(n+1)*(2*n+1)/3 \\ Charles R Greathouse IV, Oct 07 2015
-
SageMath
[n^2*(n+1)*(2*n+1)/3 for n in range(1,41)] # G. C. Greubel, Apr 09 2023
Formula
a(n) = Sum_{j=1..n} Sum_{i=1..n} (i^2 + j^2).
G.f.: 2*x*(1 + 5*x + 2*x^2)/(1-x)^5. - Colin Barker, May 04 2012
E.g.f.: (1/3)*exp(x)*x*(6 + 24*x + 15*x^2 + 2*x^3) . - Stefano Spezia, Jan 06 2020
a(n) = a(n-1) + (8*n^3 - 3*n^2 + n)/3. - Torlach Rush, Jan 07 2020
From Amiram Eldar, May 31 2022: (Start)
Sum_{n>=1} 1/a(n) = Pi^2/2 + 24*log(2) - 21.
Sum_{n>=1} (-1)^(n+1)/a(n) = Pi^2/4 - 6*Pi - 6*log(2) + 21. (End)
From G. C. Greubel, Apr 09 2023: (Start)
a(n) = (1/4)*A100431(n-1).
a(n) = 2*A108678(n-1). (End)
Extensions
More terms from Robert G. Wilson v, Nov 01 2004
New definition from Ralf Stephan, Dec 01 2004
Comments