OFFSET
0,3
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..100
FORMULA
EXAMPLE
a(3) = 8 since 3^2=9 can be partitioned into 3+3+3, 4+3+2, 4+4+1, 5+4, 5+3+1, 5+2+2, 6+3, or 6+2+1, while 3*(3*3+1)/2=15 can be partitioned into 6+5+4, 7+5+3, 7+6+2, 8+6+1, 8+5+2, 8+4+3, 9+5+1, or 9+4+2.
MAPLE
b:= proc(n, i, t) option remember;
`if`(i<t or n<t*(t+1)/2 or n>t*(2*i-t+1)/2, 0,
`if`(n=0, 1, b(n, i-1, t) +`if`(n<i, 0, b(n-i, i-1, t-1))))
end:
a:= n-> b(n*(3*n+1)/2, 3*n, n):
seq(a(n), n=0..20); # Alois P. Heinz, Jan 18 2012
MATHEMATICA
b[n_, i_, t_] := b[n, i, t] = If[i<t || n<t*(t+1)/2 || n>t*(2*i-t+1)/2, 0, If[n == 0, 1, b[n, i-1, t] + If[n<i, 0, b[n-i, i-1, t-1]]]]; a[n_] := b[n*(3*n+1)/2, 3*n, n]; Table[a[n], {n, 0, 20}] (* Jean-François Alcover, Oct 05 2015, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Henry Bottomley, Aug 05 2005
EXTENSIONS
More terms from Alois P. Heinz, Jan 18 2012
STATUS
approved