def collatz_sequence(num):
    """collatz sequence - start with positive integer. If it's even, next term
    is n/2, otherwise (3n + 1). 10 -> 5 -> 16 -> 8 -> 4 -> 2 -> 1.
    Always ends in 1. This will return [num, n2, n3, n4, ... , 1]
    """
    foo = [num]
    temp = num
    while temp != 1:
        if temp % 2 == 0:
            temp = int(temp/2)
        else:
            temp = 3*temp + 1
        foo.append(temp)
    return(foo)