basic recursive algos for gen comb and perm