OFFSET
0,7
LINKS
Index entries for linear recurrences with constant coefficients, signature (2,-2,2,-1,0,2,-4,4,-4,2,0,-1,2,-2,2,-1).
FORMULA
a(n) = Sum_{j=1..floor(n/3)} Sum_{k=j..floor((n-j)/2)} j * ((k+1) mod 2).
a(n) = 2*a(n-1) - 2*a(n-2) + 2*a(n-3) - a(n-4) + 2*a(n-6) - 4*a(n-7) + 4*a(n-8) - 4*a(n-9) + 2*a(n-10) - a(n-12) + 2*a(n-13) - 2*a(n-14) + 2*a(n-15) - a(n-16).
a(n) ~ n^3/216. - Charles R Greathouse IV, May 31 2026
EXAMPLE
a(11) = 9; There are 5 partitions of 11 into 3 parts whose middle part is even: (8,2,1), (6,4,1), (7,2,2), (5,4,2) and (4,4,3). The sum of the smallest parts of these partitions is 1+1+2+2+3 = 9.
MATHEMATICA
Table[Sum[Sum[j*Mod[k + 1, 2], {k, j, Floor[(n - j)/2]}], {j, Floor[n/3]}], {n, 0, 100}]
LinearRecurrence[{2, -2, 2, -1, 0, 2, -4, 4, -4, 2, 0, -1, 2, -2, 2, -1}, {0, 0, 0, 0, 0, 1, 3, 3, 3, 4, 6, 9, 13, 14, 16, 19}, 100]
PROG
(PARI) a(n)=(2*n^3+9*n^2+12*[6, 1, -2, -3, -2, 1, 6, 1, -2, -3, -2, 1][n%12+1]*n+[0, -23, -4, -27, -176, -103, 108, 85, -112, -135, -68, 5][n%12+1])/432 \\ Charles R Greathouse IV, May 31 2026
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Wesley Ivan Hurt, Feb 13 2026
STATUS
approved
