The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A368557 Number of compositions of n such that the set of absolute differences is a subset of the set of parts. 1
1, 1, 1, 3, 2, 2, 11, 10, 13, 27, 58, 87, 157, 253, 438, 850, 1462, 2474, 4472, 7716, 13544, 24115, 42360, 74013, 131038, 229009, 401946, 707293, 1242059, 2177682, 3828831, 6716062, 11777179, 20678592, 36267148, 63586772, 111556751, 195610763, 342949281 (list; graph; refs; listen; history; text; internal format)
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
Sequence in context: A119954 A100804 A143175 * A074248 A266004 A206703
KEYWORD
nonn
AUTHOR
John Tyler Rascoe, Dec 29 2023
EXTENSIONS
a(24)-a(38) from Alois P. Heinz, Dec 30 2023
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 10 08:02 EDT 2024. Contains 373253 sequences. (Running on oeis4.)