The Digit Factory

This relationship can be utilized as a trick by writing 12345679 and asking a person to select his favorite digit. Mentally multiply the digit he selected by 9, then write the result under the number above. Then say that inasmuch as he is fond of that digit he shall have plenty of it. Multiply the two numbers together and the digit he selected will result. Thus suppose 4 was selected; multiply 12345679 by 36, resulting in 444444444.

— Albert Beiler, Recreations in the Theory of Numbers, 1964