Nine identical looking cubes but two off by 1 gram (the two not necessarily equal to each other). However the cubes have a particular trait, when numbered they magically gain the weight of the number written on them. Without numbering there is no physical way to distinguish one cube from the next. You were hired by the owner of the nine cubes to number the cubes in such a way that the two cubes different from the others can be identified easily.
To assist with finding the cubes you have a balance scale and a marker. What is the least number of weightings needed to find the off cubes and what will be your numbering system?