OFFSET
1,2
COMMENTS
The number of partitions of 4*(n-1) into at most 3 parts. - Colin Barker, Mar 31 2015
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..200
A. Osorio, A Sequential Allocation Problem: The Asymptotic Distribution of Resources, Munich Personal RePEc Archive, 2014.
Index entries for linear recurrences with constant coefficients, signature (2,-1,1,-2,1).
FORMULA
G.f.: -x*(x+1)*(2*x^2+x+1) / ((x-1)^3*(x^2+x+1)). - Colin Barker, Mar 10 2014
a(n) = 2*a(n-1)-a(n-2)+a(n-3)-2*a(n-4)+a(n-5). - Wesley Ivan Hurt, Nov 18 2021
EXAMPLE
Count the 1's in the last column for a(n):
13 + 1 + 1 + 1
12 + 2 + 1 + 1
11 + 3 + 1 + 1
10 + 4 + 1 + 1
9 + 5 + 1 + 1
8 + 6 + 1 + 1
7 + 7 + 1 + 1
11 + 2 + 2 + 1
10 + 3 + 2 + 1
9 + 4 + 2 + 1
8 + 5 + 2 + 1
7 + 6 + 2 + 1
9 + 3 + 3 + 1
8 + 4 + 3 + 1
7 + 5 + 3 + 1
6 + 6 + 3 + 1
7 + 4 + 4 + 1
6 + 5 + 4 + 1
5 + 5 + 5 + 1
9 + 1 + 1 + 1 10 + 2 + 2 + 2
8 + 2 + 1 + 1 9 + 3 + 2 + 2
7 + 3 + 1 + 1 8 + 4 + 2 + 2
6 + 4 + 1 + 1 7 + 5 + 2 + 2
5 + 5 + 1 + 1 6 + 6 + 2 + 2
7 + 2 + 2 + 1 8 + 3 + 3 + 2
6 + 3 + 2 + 1 7 + 4 + 3 + 2
5 + 4 + 2 + 1 6 + 5 + 3 + 2
5 + 3 + 3 + 1 6 + 4 + 4 + 2
4 + 4 + 3 + 1 5 + 5 + 4 + 2
5 + 1 + 1 + 1 6 + 2 + 2 + 2 7 + 3 + 3 + 3
4 + 2 + 1 + 1 5 + 3 + 2 + 2 6 + 4 + 3 + 3
3 + 3 + 1 + 1 4 + 4 + 2 + 2 5 + 5 + 3 + 3
3 + 2 + 2 + 1 4 + 3 + 3 + 2 5 + 4 + 4 + 3
1 + 1 + 1 + 1 2 + 2 + 2 + 2 3 + 3 + 3 + 3 4 + 4 + 4 + 4
4(1) 4(2) 4(3) 4(4) .. 4n
------------------------------------------------------------------------
1 4 10 19 .. a(n)
MATHEMATICA
a[1] = 4; a[n_] := (n/(n - 1))*a[n - 1] + 4 n*Sum[(Floor[(4 n - 2 - i)/2] - i)*(Floor[(Sign[(Floor[(4 n - 2 - i)/2] - i)] + 2)/2]), {i, 0, 2 n}]; b[n_] := a[n]/(4 n); Table[b[n] - b[n - 1], {n, 50}]
LinearRecurrence[{2, -1, 1, -2, 1}, {1, 4, 10, 19, 30}, 50] (* Harvey P. Dale, Jun 13 2015 *)
Table[Count[IntegerPartitions[4 n, {4}], _?(#[[-1]]==1&)], {n, 50}] (* Harvey P. Dale, Dec 29 2021 *)
PROG
(PARI) Vec(-x*(x+1)*(2*x^2+x+1)/((x-1)^3*(x^2+x+1)) + O(x^100)) \\ Colin Barker, Sep 22 2014
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Wesley Ivan Hurt and Antonio Osorio, Mar 03 2014
STATUS
approved