I recently asked the question (Computationally Employ Sum over Ordered Partitions?) which I think I can work through. But there's a subtelty I overlooked before that problem is even well-defined, which is maybe deserving of its own question.
I'm interested in considering ordered partitions of an integer $n$. However, using a built in function like IntegerPartitions
the output will be in the form, for example:
{{3,0},{2,1},{1,2},{1,1,1}}
What I would like to do is have Mathematica write these ordered partitions as $n$-tuples. What I mean by this is best illustrated with an example. Consider $n=3$ objects, for a small $n$ example. There are two slots between the objects where we can place barriers.
$$\{\, \cdot \, | \, \cdot \, | \, \cdot \}$$
I would like the above ordered partition to be given in Mathematica by {1,1,1}
.
$$\{\, \cdot \, \, \cdot \, | \, \cdot \}$$
The above partition, I want to write as {2,0,1}
because there is no barrier in the first slot.
$$\{\, \cdot \, | \, \cdot \, \, \cdot \}$$
The above I want to write as {1,2,0}
and of course...
$$\{\, \cdot \, \, \cdot \, \, \cdot \}$$
this I want to write as {3,0,0}
. Is there a way I can manipulate Mathematica's built-in function IntegerPartitions
to do this for any $n$?