Skip to main content
OlympiadHQ

Browse · MathNet

Print

Junior Balkan Mathematical Olympiad

North Macedonia counting and probability

Problem

Let three-digit numbers satisfy the following properties: (1) No number contains the digit . (2) The sum of the digits of each number is . (3) The units digits of any two numbers are different. (4) The tens digits of any two numbers are different. (5) The hundreds digits of any two numbers are different. Find the largest possible value of .
Solution
Let denote the set of three-digit numbers that have digit sum equal to and no digit equal to . We will first find the cardinality of . We start from the number and each element of can be obtained from by a string of s (which means that we add to the current digit). Then for example can be obtained from by the string AAGAGAAA. There are in total such words, so contains numbers. Now, from the conditions (3), (4) and (5), if is in then each of the other numbers of the form cannot be in , neither can be, nor .

Since there are numbers of the first category, from the second and from the third one. In these three categories there are distinct numbers that cannot be in if is in . So, if has numbers, then are the forbidden ones that are in , but each number from can be a forbidden number no more than three times, once for each of its digits, so and since is an integer, we get . A possible example for is
Final answer
5

Techniques

Counting two ways