Collatz sequence, powers-of-two generalized to powers-of