Let's say a positive integer is simple if it has only the digits 1 or 2 (or both). How many numbers less than 1 million are simple?
With 1 digit, we have the simple numbers 1 and 2; with 2 digits, we have the $2^{2}=4$ simple numbers 11, 12, 21, and 22; with 3 digits, we have the $2^{3}=8$ simple numbers 111, 112, 121, 122, 211, 212, 221, and 222. With 4 digits, we have $2^{4}=16$ simple numbers, with 5 digits, we have $2^{5}=32$ simple numbers, and with 6 digits, we have $2^{6}=64$ simple numbers. Since a number less than 1 million has at most 6 digits, it follows that there are exactly $2+4+8+16+32+64=126$ simple numbers less than 1 million.