Ex: ending in your example with 10 009 Coarse Frangible Thread quality 100 ]]>

Let Na be the size of pile A, Qa quality of same, Nb is size of pile B, Qb is quality of same.

A mix satisfies equation K(Na+Nb) == NaQa + NbQb.

K is the quality of the resulting mix, and must be integer if you want "mass-conservation".

Now work out the table for all 4 possible oddnesses and evennesses for Na,Qa,Nb,Qb, see which ones allow an integer K.

]]>