  A two-dimensional threshold function of k-valued logic can be viewed as
coloring of the points of a k x k square lattice into two colors such that
there exists a straight line separating points of different colors. For the
number of such functions only asymptotic bounds are known. We give an exact
formula for the number of two-dimensional threshold functions and derive more
accurate asymptotics.
