OFFSET
0,8
LINKS
Index entries for linear recurrences with constant coefficients, signature (2,-2,2,-1,0,1,-2,2,-2,1).
FORMULA
a(n) = Sum_{j=1..floor(n/3)} Sum_{i=j..floor((n-j)/2)} (i mod 2).
From Colin Barker, Aug 23 2019: (Start)
G.f.: x^3*(1 - x + x^2 - x^3 + x^4) / ((1 - x)^3*(1 + x)*(1 - x + x^2)*(1 + x^2)*(1 + x + x^2)).
a(n) = 2*a(n-1) - 2*a(n-2) + 2*a(n-3) - a(n-4) + a(n-6) - 2*a(n-7) + 2*a(n-8) - 2*a(n-9) + a(n-10) for n>9.
(End)
EXAMPLE
Figure 1: The partitions of n into 3 parts for n = 3, 4, ...
1+1+8
1+1+7 1+2+7
1+2+6 1+3+6
1+1+6 1+3+5 1+4+5
1+1+5 1+2+5 1+4+4 2+2+6
1+1+4 1+2+4 1+3+4 2+2+5 2+3+5
1+1+3 1+2+3 1+3+3 2+2+4 2+3+4 2+4+4
1+1+1 1+1+2 1+2+2 2+2+2 2+2+3 2+3+3 3+3+3 3+3+4 ...
-----------------------------------------------------------------------
n | 3 4 5 6 7 8 9 10 ...
-----------------------------------------------------------------------
a(n) | 1 1 1 1 2 3 4 4 ...
-----------------------------------------------------------------------
MATHEMATICA
Table[Sum[Sum[Mod[i, 2], {i, j, Floor[(n - j)/2]}], {j, Floor[n/3]}], {n, 0, 80}]
LinearRecurrence[{2, -2, 2, -1, 0, 1, -2, 2, -2, 1}, {0, 0, 0, 1, 1, 1, 1, 2, 3, 4}, 80]
PROG
(PARI) a(n) = sum(j=1, n\3, sum(i=j, (n-j)\2, i % 2)); \\ Michel Marcus, Aug 23 2019
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Wesley Ivan Hurt, Aug 12 2019
STATUS
approved