%I #24 Sep 08 2022 08:46:15
%S 0,2,14,44,100,190,322,504,744,1050,1430,1892,2444,3094,3850,4720,
%T 5712,6834,8094,9500,11060,12782,14674,16744,19000,21450,24102,26964,
%U 30044,33350,36890,40672,44704,48994,53550,58380,63492,68894,74594,80600,86920
%N a(n) = n*(n + 1)*(4*n - 1)/3.
%C Partial sums of A002939.
%C a(n) is the maximum value obtainable by partitioning the set {x in the natural numbers | 1 <= x <= 2n} into pairs, taking the products of all such pairs, and taking the sum of all such products. - _Thomas Anton_, Oct 20 2020
%H <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (4,-6,4,-1).
%F G.f.: 2*x*(3*x + 1)/(x - 1)^4.
%F a(n) = Sum_{k = 0..n} 2*k*(2*k - 1).
%F Sum_{n>=1} 1/a(n) = -3*(2*Pi - 12*log(2) + 1)/5 = 0.620748515723854...
%F a(n) mod 2 = 0.
%F Sum_{n>=1} (-1)^(n+1)/a(n) = 3*(1 + 2*sqrt(2)*Pi - 2*(3 + sqrt(2))*log(2) + 4*sqrt(2)*log(2-sqrt(2)))/5. - _Amiram Eldar_, Nov 05 2020
%e a(0) = 0;
%e a(1) = 0 + 1*2 = 2;
%e a(2) = 0 + 1*2 + 3*4 = 14;
%e a(3) = 0 + 1*2 + 3*4 + 5*6 = 44;
%e a(4) = 0 + 1*2 + 3*4 + 5*6 + 7*8 = 100;
%e a(5) = 0 + 1*2 + 3*4 + 5*6 + 7*8 + 9*10 = 190, etc.
%t Table[n (n + 1) ((4 n - 1)/3), {n, 0, 40}] (* or *)
%t LinearRecurrence[{4, -6, 4, -1}, {0, 2, 14, 44}, 40]
%t CoefficientList[Series[2 x (3 x + 1) / (x - 1)^4, {x, 0, 40}], x] (* _Vincenzo Librandi_, Feb 11 2016 *)
%o (Magma) [n*(n + 1)*(4*n - 1)/3: n in [0..40]]; // _Vincenzo Librandi_, Feb 11 2016
%o (PARI) a(n)=n*(n+1)*(4*n-1)/3 \\ _Charles R Greathouse IV_, Jul 26 2016
%Y Cf. A001477, A002939, A005408, A005843, A135036.
%K nonn,easy
%O 0,2
%A _Ilya Gutkovskiy_, Feb 11 2016