OFFSET
0,4
LINKS
John Tyler Rascoe, Python program
EXAMPLE
For n=12, composition [2,1,2,4,3] of 12 has the set of absolute differences {1,2}, which is a subset of the set of parts {1,2,3,4}, so it counts towards a(12) = 157.
a(3) = 3 compositions: [3], [2,1], [1,2].
a(6) = 11 compositions: [6], [4,2], [2,4], [3,2,1], [3,1,2], [2,3,1], [2,1,3], [1,3,2], [1,2,3], [2,1,2,1], [1,2,1,2].
MATHEMATICA
g[0] = {{}}; g[n_Integer] := g[n] = Flatten[ParallelTable[Append[#, i] & /@ g[n - i], {i, 1, n}], 1];
isC[p_List] := Module[{d}, d = Abs[Differences[p]]; Union[d] === Union[Select[d, MemberQ[p, #] &]]];
a[n_Integer] := a[n] = Count[g[n], p_ /; isC[p]];
Monitor[Table[a[n], {n, 0, 19}], {n, Table[a[m], {m, 0, n - 1}]}] (* Robert P. P. McKone, Jan 02 2024 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
John Tyler Rascoe, Dec 29 2023
EXTENSIONS
a(24)-a(38) from Alois P. Heinz, Dec 30 2023
STATUS
approved