def is_wall(x, y, modifier=0):
    """
    You can determine whether a given x,y coordinate will be a wall or an open space
    using a simple system:

        * Find x*x + 3*x + 2*x*y + y + y*y.
        * Add the office designer's favorite number (your puzzle input).
        * Find the binary representation of that sum; count the number of bits
          that are 1.
        * If the number of bits that are 1 is even, it's an open space.
        * If the number of bits that are 1 is odd, it's a wall.
    """
    value = x*x + 3*x + 2*x*y + y + y*y
    value += modifier
    bin_value = bin(value)[2:] # discard leading '0b' bytes indicator
    ones = bin_value.count('1')
    return ones % 2 == 1