counterfeit coin problem

The counterfeit coin problem may be stated as follows: Among n coins, identical in size, shape, and appearance, one is a counterfeit and has a slightly different weight than the others. Using only a two-pan balance, what is the smallest number of weighings that would guarantee finding the fake coin? The problem of the counterfeit coin (or some other object), especially involving 8, 10, 12, or 13 coins, has cropped up in many guises over the years. Typically, the problem also involves finding whether the counterfeit coin is lighter or heavier than the rest.