--- from: http://rosettacode.org/wiki/Non-continuous_subsequences note: Discrete math