Freeman Dyson's algorithm for solving the generalized 12 coins puzzle.
Dyson, Freeman J. "Note 1931--The problem of the pennies," The Mathematical Gazette Vol. 30, No 291) (October 1946). JSTOR link
My writeups on the algorithm:
-
The special case when $M = (3^n - 3)/2$ (M the number of coins, n the number of weighings). This is the case for 12 coins in 3 weighings.