Task 10.1. Find the largest 12-digit number $N$ that satisfies the following two conditions:

- In the decimal representation of the number $N$, there are six digits «4» and six digits «7»;
- In the decimal representation of the number $N$, no four consecutive digits form the number «7444».
Answer: 777744744744.

Solution. It is clear that the number 777744744744 meets the condition of the problem.

Suppose there exists a larger number, then it must start with four sevens. In this number, we select the largest number of consecutive fours, let there be $k$ of them. If $k \geqslant 3$, then by selecting among these $k$ fours the three leftmost ones, as well as the seven to the left of them, we get a segment of digits "7444," which is a contradiction.

Therefore, $k \leqslant 2$. In the last eight digits of the number, there must be six fours. Since no three consecutive digits can all be fours, the last eight digits are uniquely determined: they are 44744744. But the corresponding number 777744744744 we have already found.