def collatz(num):
    """
        if n is even, n/2
        if n is odd, 3n+1
    """
    newlist = [num]
    while num != 1:
        if num%2 == 0:
            num //= 2
        elif num%2 == 1:
            num = 3*num + 1
        newlist.append(num)
    return newlist