**Solution:**

For an m×n chessboard there are 2^{m}+2^{n}−2 ways.

Case I. There are two horizontally adjacent squares of the same color: 2^{m}−2 ways.

Case II. There are two vertically adjacent squares of the same color: 2^{n}−2 ways.

Case III. None of the above: 2 ways.

**Hint for Case I:** There are 2^{m}−2 ways to color one row so that two adjacent squares have the same color.

The rest of the coloring is determined from that; colors must alternate in each column. (Note, therefore, that Cases I and II do not overlap.)