Baltic Way 1994 · Problem 10
Number Theory
How many positive integers satisfy the following three conditions:
(i) All digits of the number are from the set ;
(ii) The absolute value of the difference between any two consecutive digits is 1 ;
(iii) The integer has 1994 digits?
When you’re ready
Review material becomes available with the next Daily.
Review
Topics
Divisibility and factorization
Solutions
Solution
Solution:
Consider all positive integers with digits satisfying conditions and of the problem. Let the number of such integers beginning with and be and , respectively. Then, for we have (integer ), (integers and ), (integers and ), (integers and ) and (integer ). Observe that .
Suppose now that , i.e., the integers have at least four digits. If an integer begins with the digit then the second digit is while the third can be or . This gives the relation
Similarly, if the first digit is , then the second is while the third can be or . This implies
If the integer begins with then the third digit is or . If the integer begins with then the third digit is . From this we can conclude that
In the same manner we can show that
If the integer begins with then the third digit must be or , and if it begins with the third digit is or . Hence
From (1), (2) and (5) it follows that , which is true for all . On the other hand, adding the relations (1)-(5) results in
and, since ,
Thus the number of integers satisfying conditions and increases three times when we increase the number of digits by . Since the number of such integers with two digits is , and , the number of integers satisfying all three conditions is .
Contest context
Results from Baltic Way 1994
9 teams
- Mean score
- 3.8 / 5
- Scores of 4 or 5
- 7 / 9
- Estonia
- 5 / 5
Score distribution
All team scores
| Team | Score |
|---|---|
| St. Petersburg | 5 / 5 |
| Latvia | 5 / 5 |
| Poland | 5 / 5 |
| Sweden | 5 / 5 |
| Denmark | 5 / 5 |
| Estonia | 5 / 5 |
| Finland | 4 / 5 |
| Lithuania | 0 / 5 |
| Iceland | 0 / 5 |