login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

A368501
Number of compositions (ordered partitions) of n into distinct parts not greater than n/2.
1
1, 0, 0, 0, 0, 0, 6, 0, 6, 6, 36, 30, 66, 60, 120, 234, 318, 432, 666, 894, 1272, 2226, 2772, 3960, 5496, 7524, 10068, 13776, 22488, 27756, 39162, 51264, 70398, 91386, 124152, 158574, 247554, 301656, 416748, 537690, 730854, 929196, 1248798, 1576014, 2078328, 2956110
OFFSET
0,7
FORMULA
a(n) = Sum_{k=1..floor(n/2)} A072575(n,k) for n>=1. - Alois P. Heinz, Dec 31 2023
EXAMPLE
a(6) = 6 because we have [1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2] and [3,2,1].
MAPLE
b:= proc(n, i, p) option remember; `if`(i*(i+1)/2<n, 0,
`if`(n=0, p!, b(n, i-1, p)+b(n-i, min(n-i, i-1), p+1)))
end:
a:= n-> b(n, iquo(n, 2), 0):
seq(a(n), n=0..45); # Alois P. Heinz, Dec 28 2023
MATHEMATICA
Table[Sum[Count[IntegerPartitions[n, {k}], _?(And[UnsameQ @@ #, AllTrue[#, # <= n/2 &]] &)] k!, {k, 0, n}], {n, 0, 45}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Ilya Gutkovskiy, Dec 27 2023
STATUS
approved