アホだ...こうしないと動かないよな
def collatz(n):
    while n > 1:
        yield n
        n = n % 2 and 3 * n + 1 or n / 2

>>147
どんな出力を求めてるのかが、いまいちよくわからない