%I #56 Apr 11 2023 08:42:55
%S 2,20,84,240,550,1092,1960,3264,5130,7700,11132,15600,21294,28420,
%T 37200,47872,60690,75924,93860,114800,139062,166980,198904,235200,
%U 276250,322452,374220,431984,496190,567300,645792,732160,826914,930580,1043700
%N a(n) = n^2*(n+1)*(2*n+1)/3.
%C Sum of all matrix elements M(i,j) = i^2 + j^2 (i,j = 1,...,n).
%C From _Torlach Rush_, Jan 05 2020: (Start)
%C a(n) = n * A006331(n).
%C tr(M(n)) = A006331(n).
%C The sum of the antidiagonal of M(n) equals tr(M(n)).
%C M(n) = M(n)' (Symmetric).
%C M(1,) = M(,1) = A002522(n), n > 0.
%C M(2,) = M(,2) = A087475(n), n > 0.
%C M(3,) = M(,3) = A189834(n), n > 0.
%C M(4,) = M(,4) = A241751(n), n > 0.
%C (End)
%C Consider the partitions of 2n into two parts (p,q) where p <= q. Then a(n) is the total volume of the family of rectangular prisms with dimensions p, p and p+q. - _Wesley Ivan Hurt_, Apr 15 2018
%H Vincenzo Librandi, <a href="/A098077/b098077.txt">Table of n, a(n) for n = 1..1000</a>
%H <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (5,-10,10,-5,1).
%F a(n) = Sum_{j=1..n} Sum_{i=1..n} (i^2 + j^2).
%F G.f.: 2*x*(1 + 5*x + 2*x^2)/(1-x)^5. - _Colin Barker_, May 04 2012
%F E.g.f.: (1/3)*exp(x)*x*(6 + 24*x + 15*x^2 + 2*x^3) . - _Stefano Spezia_, Jan 06 2020
%F a(n) = a(n-1) + (8*n^3 - 3*n^2 + n)/3. - _Torlach Rush_, Jan 07 2020
%F From _Amiram Eldar_, May 31 2022: (Start)
%F Sum_{n>=1} 1/a(n) = Pi^2/2 + 24*log(2) - 21.
%F Sum_{n>=1} (-1)^(n+1)/a(n) = Pi^2/4 - 6*Pi - 6*log(2) + 21. (End)
%F From _G. C. Greubel_, Apr 09 2023: (Start)
%F a(n) = (1/4)*A100431(n-1).
%F a(n) = 2*A108678(n-1). (End)
%e a(2) = (1^2 + 1^2) + (1^2 + 2^2) + (2^2 + 1^2) + (2^2 + 2^2) = 2 + 5 + 5 + 8 = 20.
%t Table[ Sum[i^2 + j^2, {i, n}, {j, n}], {n, 35}]
%t LinearRecurrence[{5, -10, 10, -5, 1}, {2, 20, 84, 240, 550}, 40] (* _Vincenzo Librandi_, Apr 16 2018 *)
%o (PARI) a(n)=n^2*(n+1)*(2*n+1)/3 \\ _Charles R Greathouse IV_, Oct 07 2015
%o (Magma) [n^2*(n+1)*(2*n+1)/3: n in [1..40]]; // _G. C. Greubel_, Apr 09 2023
%o (SageMath) [n^2*(n+1)*(2*n+1)/3 for n in range(1,41)] # _G. C. Greubel_, Apr 09 2023
%Y Cf. A002522, A006331, A087475, A100431, A108678, A189834, A241751.
%K nonn,easy
%O 1,1
%A _Alexander Adamchuk_, Oct 24 2004
%E More terms from _Robert G. Wilson v_, Nov 01 2004
%E New definition from _Ralf Stephan_, Dec 01 2004
|