How many integers between 1 and 10^18 are such that the sum of their digits is 2?  Choose the correct choice from the following answers: A) 161 B) 171 C) 181 D) 191 E) 201
The integers with a sum of 2 are:   2, 20, 200,...,2*10^17 and there are 18 integers in this list.   Also, these integers have a sum of 2:   11   101, 110   1001, 1010, 1100   etc...   The number of integers in this list is 1 + 2 + ... + 17   Thus, the total number of integers is 1 + 2 + ... + 17 + 18 = 18*19/2= 
<gadget id="calculator">18*19/2</gadget>
<output>171</output>
171   The answer is 171.
<result>B</result>
How many integers between 1 and 10^18 are such that the sum of their digits is 2?