next_permtuation for 13! and up