Given a balance scale that is sure to break after X weighings, find an equation for the largest number of coins N, from which you can determine a fake coin that has the wrong weight if
A: You know whether the fake is lighter or heavier
B: You do not know whether the fake is lighter or heavier
(Assume only one of the N coins is fake)
OK, I think I've finally cracked part B (type of 'fakeness' unknown). I can manage up to:
4 coins in 2 weighings
13 coins in 3 weighings
40 coins in 4 weighings.
It would appear that this generalises to
n = 1 + 3 + 9 + ... 3^(x-1) coins in x weighings, or n = (3^x-1)/2.