Skip to main content
OlympiadHQ

Browse · MATH

Print

jmc

counting and probability senior

Problem

Let be the number of positive integers that are less than or equal to and whose base- representation has more 's than 's. Find the remainder when is divided by .
Solution
In base- representation, all positive numbers have a leftmost digit of . Thus there are numbers that have digits in base notation, with of the digits being 's. In order for there to be more 's than 's, we must have . Therefore, the number of such numbers corresponds to the sum of all numbers on or to the right of the vertical line of symmetry in Pascal's Triangle, from rows to (as ). Since the sum of the elements of the th row is , it follows that the sum of all elements in rows through is . The center elements are in the form , so the sum of these elements is . The sum of the elements on or to the right of the line of symmetry is thus . However, we also counted the numbers from to . Indeed, all of these numbers have at least 's in their base- representation, as all of them are greater than , which has 's. Therefore, our answer is , and the remainder is .
Final answer
155