IdxAllSpanned function

Find the indexes of the spanned factors