Representing solutions

For a homogeneous problem, the solution is any linear combination of the resulting vectors.
For a non-homogeneous problem, the solution is any linear combination of the vectors in the
second component plus one of the vectors in the first component.

Find the basis solution. By definition, the basis has all non-trivial (i.e., non-0) solutions
that cannot be written as the sum of two other solutions. We use the mathematically equivalent
statement that a solution is in the basis if it's least according to the lexicographic
order using the ordinary less-than relation.

for arbitrary k, k'. It's easy to see that these are really solutions
to the equation given. It's harder to see that they cover all possibilities,
but a moments thought reveals that is indeed the case.

A puzzle: Five sailors and a monkey escape from a naufrage and reach an island with
coconuts. Before dawn, they gather a few of them and decide to sleep first and share
the next day. At night, however, one of them awakes, counts the nuts, makes five parts,
gives the remaining nut to the monkey, saves his share away, and sleeps. All other
sailors do the same, one by one. When they all wake up in the morning, they again make 5 shares,
and give the last remaining nut to the monkey. How many nuts were there at the beginning?

Note that this is the minimum solution, that is, we are guaranteed that there's
no solution with less number of coconuts. In fact, any member of [15625*k-4 | k <- [1..]]
is a solution, i.e., so are 31246, 46871, 62496, 78121, etc.