%I #37 Nov 19 2021 17:18:24
%S 1,5,18,40,80,135,217,320,459,625,836,1080,1378,1715,2115,2560,3077,
%T 3645,4294,5000,5796,6655,7613,8640,9775,10985,12312,13720,15254,
%U 16875,18631,20480,22473,24565,26810,29160,31672,34295,37089,40000,43091,46305,49708
%N Sum of all the middle parts in the partitions of 3n into 3 parts.
%H Vincenzo Librandi, <a href="/A236364/b236364.txt">Table of n, a(n) for n = 1..1000</a>
%H <a href="/index/Par#part">Index entries for sequences related to partitions</a>
%H <a href="/index/Rec#order_06">Index entries for linear recurrences with constant coefficients</a>, signature (2,1,-4,1,2,-1).
%F a(n) = A000330(n) + Sum_{i=1..floor((n-1)/2)} (n + i)*(n - 2i).
%F a(n) = n*(n+1)*(2*n+1)/6 - floor((n-1)/2) * (4*floor((n-1)/2)^2 + 3*(n+2)*floor((n-1)/2) - 6*n^2 + 3*n + 2)/6.
%F G.f.: x*(x^4+3*x^3+7*x^2+3*x+1)/((x-1)^4*(x+1)^2). - _Joerg Arndt_, Jan 23 2014
%F a(n) = (n*(3-3*(-1)^n+10*n^2))/16. - _Colin Barker_, Jan 23 2014
%F a(n) = (n^3 + ceiling(n/2)^3 + floor(n/2)^3)/2. - _Wesley Ivan Hurt_, Apr 15 2016
%F a(n) = 2*a(n-1)+a(n-2)-4*a(n-3)+a(n-4)+2*a(n-5)-a(n-6). - _Wesley Ivan Hurt_, Nov 19 2021
%e Add second columns for a(n):
%e 13 + 1 + 1
%e 12 + 2 + 1
%e 11 + 3 + 1
%e 10 + 4 + 1
%e 9 + 5 + 1
%e 8 + 6 + 1
%e 7 + 7 + 1
%e 10 + 1 + 1 11 + 2 + 2
%e 9 + 2 + 1 10 + 3 + 2
%e 8 + 3 + 1 9 + 4 + 2
%e 7 + 4 + 1 8 + 5 + 2
%e 6 + 5 + 1 7 + 6 + 2
%e 7 + 1 + 1 8 + 2 + 2 9 + 3 + 3
%e 6 + 2 + 1 7 + 3 + 2 8 + 4 + 3
%e 5 + 3 + 1 6 + 4 + 2 7 + 5 + 3
%e 4 + 4 + 1 5 + 5 + 2 6 + 6 + 3
%e 4 + 1 + 1 5 + 2 + 2 6 + 3 + 3 7 + 4 + 4
%e 3 + 2 + 1 4 + 3 + 2 5 + 4 + 3 6 + 5 + 4
%e 1 + 1 + 1 2 + 2 + 2 3 + 3 + 3 4 + 4 + 4 5 + 5 + 5
%e 3(1) 3(2) 3(3) 3(4) 3(5) .. 3n
%e ------------------------------------------------------------------------
%e 1 5 18 40 80 .. a(n)
%p A236364:=n->n*(n+1)*(2*n+1)/6 - floor((n-1)/2) * (4*floor((n-1)/2)^2 + (3*n+6)*floor((n-1)/2) - 6*n^2 + 3*n + 2)/6; seq(A236364(n), n=1..100);
%t Table[Sum[i^2, {i, n}] + Sum[(n + i) (n - 2 i), {i, Floor[(n - 1)/2]}], {n, 100}]
%t CoefficientList[Series[(x^4 + 3 x^3 + 7 x^2 + 3 x + 1)/ ((x - 1)^4 (x + 1)^2), {x, 0, 50}], x] (* _Vincenzo Librandi_, Feb 18 2014 *)
%o (PARI) Vec(x*(x^4+3*x^3+7*x^2+3*x+1)/((x-1)^4*(x+1)^2) + O(x^100)) \\ _Colin Barker_, Jan 23 2014
%Y Cf. A000330, A019298, A235988.
%K nonn,easy
%O 1,2
%A _Wesley Ivan Hurt_, Jan 23 2014
%E Name clarified by _Wesley Ivan Hurt_, Apr 16 2016