Skip to main content
OlympiadHQ

Browse · MathNet

Print

55rd Ukrainian National Mathematical Olympiad - Fourth Round

Ukraine number theory

Problem

Determine the maximum positive integer that is divisible by , and all digits of which are odd, and their sum equals .
Solution
It is obvious that the greater the number is, the more digits it has. Since every digit equals at least , the maximum amount of digits is . Such number is unique: , since every digit is and their sum is .

However, (with digits) is not divisible by . For example, , but and , so this number is not divisible by .

It is not possible that the number has digits, since the sum of odd numbers cannot be odd. That means that the maximum amount of digits in the number is . Obviously, it consists of digits and one digit , since no other cases are possible. We will find the maximum number with such structure that is divisible by . That means we have to find such number with the digit in the maximum possible position. Thus the number will look like , where , and is divisible by and is the maximum possible number.

Since , and and , then . Since , then . Consider periodicity of remainders of such numbers modulo (remembering that ): And so on. Thus values for will look like . Since , then the maximum possible value for , therefore, the maximum number is (with digits after the ).
Final answer
A = (10^2013 − 1)/9 + 2·10^2008, i.e., the 2013-digit number with four ones, then a three, followed by 2008 ones

Techniques

Modular ArithmeticDivisibility / FactorizationIntegers