Problem 1073
The members of this family of positive integers have the following characteristics- their decimal writing contains 15 digits taken exclusively from 1, 2, 3 or 4;
- the difference between two consecutive digits is necessarily 1.
- 1. How many numbers are there in this family? (10 points)
Fascinated by these properties, Bob observes the figures of the thousands of all these numbers (4th figure from the left). After having counted them, he writes in succession, from left to right, without separation, the number of 1 then the number of 2 which appear among the figures of the thousands.
- 2. What is the number written by Bob? (10 points)
For this problem, the program is simple because a naive enumeration does not pose a particular complexity issue, and the implementation is rather straightforward. There is no particular reason for using python.
The code is available here.
The code is available here.
- 1. 3194
- 2. 4321165