1 | initial version |
I am not familiar with partitions, so i do not know if this has a name. However, if i understand correctly, P is a kind of discrete integral of D, so D is a kind of discrete derivative, that is defined by first differences. So, you can do something like:
sage: for p in Partitions(7):
....: print p, [p[i]-p[i+1] for i in range(len(p)-1)] + [p[-1]]
....:
[7] [7]
[6, 1] [5, 1]
[5, 2] [3, 2]
[5, 1, 1] [4, 0, 1]
[4, 3] [1, 3]
[4, 2, 1] [2, 1, 1]
[4, 1, 1, 1] [3, 0, 0, 1]
[3, 3, 1] [0, 2, 1]
[3, 2, 2] [1, 0, 2]
[3, 2, 1, 1] [1, 1, 0, 1]
[3, 1, 1, 1, 1] [2, 0, 0, 0, 1]
[2, 2, 2, 1] [0, 0, 1, 1]
[2, 2, 1, 1, 1] [0, 1, 0, 0, 1]
[2, 1, 1, 1, 1, 1] [1, 0, 0, 0, 0, 1]
[1, 1, 1, 1, 1, 1, 1] [0, 0, 0, 0, 0, 0, 1]