def update(c,n):
    """ update starts with z=0 and runs z = z**2 + c
         for a total of n times. It returns the final z.
     """
    result = 0
    for x in range(n):
        if x == n:
            return result
        result = result**2 + c
    return result