OFFSET
0,5
COMMENTS
For even n, the sequence gives the sum of the largest parts of the partitions of n into two parts. For odd n, the sequence gives the sum of the smallest parts of the partitions of n into two parts (see example).
LINKS
Muniru A Asiru, Table of n, a(n) for n = 0..3000 (first 56 terms from Wesley Ivan Hurt)
Index entries for linear recurrences with constant coefficients, signature (0,3,0,-3,0,1).
FORMULA
G.f.: x^2*(1+x+2*x^2)/(1-x^2)^3.
a(n) = 3*a(n-2)-3*a(n-4)+a(n-6), a(0)=a(1)=0, a(2)=a(3)=1, a(4)=5, a(5)=3.
a(n) = (4*n^2 - 2*n - 1 + (2*n^2 - 2*n + 1)*(-1)^n)/16.
a(n) = floor(n/2) * ((1+floor(n/2))*(n mod 2) + (2*n-1-floor(n/2))*((n+1) mod 2))/2.
Sum_{n>=2} 1/a(n) = 2 - Pi/sqrt(3) + 3*log(3). - Amiram Eldar, Aug 25 2022
EXAMPLE
a(4) = 5; the partitions of 4 into two parts are: (3,1), (2,2). Since 4 is even, we add the largest parts in these partitions to get 5.
a(5) = 3; the partitions of 5 into two parts are: (4,1), (3,2). Since 5 is odd, we add the smallest parts in the partitions to get 3.
MATHEMATICA
Table[(4n^2 - 2n - 1 + (2n^2 - 2n + 1) (-1)^n)/16, {n, 0, 50}] (* or *)
CoefficientList[Series[x^2 (1 + x + 2*x^2)/(1 - x^2)^3, {x, 0, 50}], x]
PROG
(Magma) [(4*n^2-2*n-1+(2*n^2-2*n+1)*(-1)^n)/16 : n in [0..50]];
(PARI) concat([0, 0], Vec(x^2*(1+x+2*x^2)/(1-x^2)^3 + O(x^100))) \\ Colin Barker, Jul 25 2014
(GAP) a := List([0..10^2], n->(4*n^2-2*n-1+(2*n^2-2*n+1)*(-1)^n)/16); # Muniru A Asiru, Feb 02 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Wesley Ivan Hurt, Jul 23 2014
STATUS
approved