OFFSET
0,3
COMMENTS
A composition of n is a finite sequence of positive integers summing to n.
The contiguous case is A325676.
EXAMPLE
The a(1) = 1 through a(6) = 19 compositions:
(1) (2) (3) (4) (5) (6)
(1,1) (1,2) (1,3) (1,4) (1,5)
(2,1) (2,2) (2,3) (2,4)
(1,1,1) (3,1) (3,2) (3,3)
(1,1,1,1) (4,1) (4,2)
(1,1,3) (5,1)
(1,2,2) (1,1,4)
(2,2,1) (2,2,2)
(3,1,1) (4,1,1)
(1,1,1,1,1) (1,1,1,1,1,1)
MAPLE
b:= proc(n, s) option remember; `if`(n=0, 1, add((h->
`if`(nops(h)=nops(map(l-> add(i, i=l), h)),
b(n-j, h), 0))({s[], map(l-> [l[], j], s)[]}), j=1..n))
end:
a:= n-> b(n, {[]}):
seq(a(n), n=0..23); # Alois P. Heinz, Jun 03 2020
MATHEMATICA
Table[Length[Select[Join@@Permutations/@IntegerPartitions[n], UnsameQ@@Total/@Union[Subsets[#]]&]], {n, 0, 15}]
CROSSREFS
These compositions are ranked by A334967.
Compositions where every restriction to a subinterval has a different sum are counted by A169942 and A325677 and ranked by A333222. The case of partitions is counted by A325768 and ranked by A325779.
Knapsack partitions are counted by A108917 and A325592 and ranked by A299702, while the strict case is counted by A275972 and ranked by A059519 and A301899.
KEYWORD
nonn
AUTHOR
Gus Wiseman, Jun 02 2020
EXTENSIONS
a(18)-a(47) from Alois P. Heinz, Jun 03 2020
STATUS
approved