IMO 1983 LL CAN15

Find all possible finite sequences {n0, n1, n2, . . . , nk} of integers

IMO 1983 LL CAN15

Origin: CAN

Problem

Find all possible finite sequences {n0, n1, n2, . . . , nk} of integers such that for each i, i appears in the sequence ni times (0 \leqi \leqk).