def next_collatz(n):
    """ Takes an integer n and returns the following integer in the Collatz sequence.

        If n is even, it returns n divided by 2.
        If n is odd, it returns (3*n) + 1.

        The end of a collatz sequence is traditionally 1, so we will raise an
        exception if the n passed is 1.
    """
    if n <= 1:
        raise ValueError('eular14.next_collatz: n must be a positive integer larger than 1!')
    elif n % 2 == 0:
        return n // 2
    else:
        return (3 * n) + 1