Call a positive integer an uphill integer if every digit is strictly greater than the previous digit. For example, , , and are all uphill integers, but , , and are not. How many uphill integers are divisible by ?
- A)
- B)
- C)
- D)
- E)
Answer
C
Key insight
Uphill numbers cannot end in 0, so the last digit is 5; choose a subset of {1,2,3,4} whose sum with 5 is a multiple of 3.
Solution
Divisible by means divisible by and by .
Divisible by 5. The last digit is or . In an uphill integer the last digit is the largest digit, so it cannot be . Hence the number ends in , and its earlier digits form an increasing string chosen from (a leading is not allowed).
Divisible by 3. The digit sum must be a multiple of . The chosen subset of must have sum (since ). Listing subsets by sum:
- sum : , sum : , sum : , sum : .
Those six subsets give the numbers , all multiples of . (The empty subset gives , not divisible by .)
The answer is .
Why this works
Strictly increasing digits means the number is determined by its set of digits, so counting uphill integers is counting subsets. Divisibility rules then become conditions on the set: the largest element is , and the sum is a multiple of . Convert digit conditions into set conditions and enumerate.
The trap
Allowing numbers ending in 0 (such as 120 or 1230), which are not uphill since 0 is less than the previous digit.
Common mistakes
- Allowing numbers ending in 0 (such as 120 or 1230), which are not uphill since 0 is less than the previous digit.
- Checking divisibility by only for two-digit candidates and missing or .
Techniques
Organized listing / direct enumeration