OFFSET
0,3
COMMENTS
A composition of n is a finite sequence of positive integers summing to n.
Compare to the definition of knapsack partitions (A108917).
LINKS
Fausto A. C. Cariboni, Table of n, a(n) for n = 0..100
EXAMPLE
The distinct consecutive subsequences of (1,4,4,3) together with their sums are:
1: {1}
3: {3}
4: {4}
5: {1,4}
7: {4,3}
8: {4,4}
9: {1,4,4}
11: {4,4,3}
12: {1,4,4,3}
Because the sums are all different, (1,4,4,3) is counted under a(12).
The a(1) = 1 through a(6) = 12 compositions:
(1) (2) (3) (4) (5) (6)
(11) (12) (13) (14) (15)
(21) (22) (23) (24)
(111) (31) (32) (33)
(1111) (41) (42)
(113) (51)
(122) (114)
(221) (132)
(311) (222)
(11111) (231)
(411)
(111111)
MATHEMATICA
Table[Length[Select[Join@@Permutations/@IntegerPartitions[n], UnsameQ@@Total/@Union[ReplaceList[#, {___, s__, ___}:>{s}]]&]], {n, 0, 15}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Gus Wiseman, May 13 2019
EXTENSIONS
a(21)-a(22) from Jinyuan Wang, Jun 20 2020
a(23)-a(25) from Robert Price, Jun 19 2021
a(26)-a(46) from Fausto A. C. Cariboni, Feb 10 2022
STATUS
approved