OFFSET
0,3
EXAMPLE
The composition c = (2,3,1) has 0-prepended first differences (2,1,-2), which are all distinct, so c is counted under a(6).
The composition d = (2,1,3) has 0-prepended first differences (2,-1,2), which are not all distinct, so d is not counted under a(6).
The a(1) = 1 through a(6) = 14 compositions:
(1) (2) (3) (4) (5) (6)
(1,1) (2,1) (1,3) (1,4) (1,5)
(2,2) (2,3) (3,3)
(3,1) (3,2) (4,2)
(2,1,1) (4,1) (5,1)
(1,1,3) (1,1,4)
(1,3,1) (1,3,2)
(2,1,2) (1,4,1)
(2,2,1) (2,3,1)
(3,1,1) (3,1,2)
(4,1,1)
(1,1,3,1)
(1,3,1,1)
(2,1,1,2)
MATHEMATICA
Table[Length[Select[Join@@Permutations/@IntegerPartitions[n], UnsameQ@@Differences[Prepend[#, 0]]&]], {n, 0, 15}]
PROG
(Python)
from sympy.combinatorics.partitions import IntegerPartition
from sympy.utilities.iterables import partitions, multiset_permutations
def compositions(n): yield from (c for p in partitions(n) for c in multiset_permutations(IntegerPartition(p).partition))
def diffs(t): return [t[i]-t[i-1] for i in range(1, len(t))]
def a(n): return sum(1 for c in compositions(n) if len(t:=diffs([0]+c))==len(set(t)))
print([a(n) for n in range(20)]) # Michael S. Branicky, Oct 25 2025
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Gus Wiseman, Oct 23 2025
EXTENSIONS
a(26)-a(34) from Michael S. Branicky, Oct 25 2025
STATUS
approved
