Macaulay representation of an integer

Given positive integers formula_1 and formula_2, the formula_2-th Macaulay representation of formula_1 is an expression for formula_1 as a sum of binomial coefficients:
Here, formula_7 is a uniquely determined, strictly increasing sequence of nonnegative integers known as the Macaulay coefficients. For any two positive integers formula_8 and formula_9, formula_10 if and only if the sequence of Macaulay coefficients for formula_8 comes before the sequence of Macaulay coefficients for formula_9 in lexicographic order.