add get_ith_perm_by_orders() functions