## Task B-1.7.

On each coupon of the spring lottery, next to the spring number, there is a sequence of seven digits, ranging from 0000000 to 9999999. If the coupon is rotated by $180^{\circ}$, the digits 0 and 8 do not change, the digits 6 and 9 transform into each other, and all other digits lose their meaning. Thus, the spring number 9980896 will change to 9680866 upon rotation. Coupons whose spring numbers change their decimal value upon a $180^{\circ}$ rotation are considered invalid. How many invalid coupons are there?

(Note: A coupon with the spring number 8680898 or 0808080 is a valid coupon.)
## Solution.

Invalid coupons are those whose numbers contain the digits $0,6,8,9$, and do not contain any of the digits $1,2,3,4,5$ or 7.

There are a total of $4 \cdot 4 \cdot 4 \cdot 4 \cdot 4 \cdot 4 \cdot 4=4^{7}$ seven-digit numbers that contain the digits $0,6,8,9$ (leading zeros are allowed).

From this number, we need to subtract all the numbers that do not change their decimal value when rotated.

For such numbers, the middle digit (the fourth digit) must be 0 or 8.

The first, second, and third digits can be any of the digits $0,6,8,9$. However, for each choice of these three digits, there is only one possible choice for the fifth, sixth, and seventh digits.

Thus, the first, second, and third digits can be chosen in $4^{3}$ ways, the fourth digit in 2 ways, and the fifth, sixth, and seventh digits in one way.

The total number of numbers that do not change their value when rotated is $4^{3} \cdot 2=128$.

The number of invalid coupons is $4^{7}-4^{3} \cdot 2=4^{3}\left(4^{4}-2\right)=64 \cdot 254=26256$.

Note: A final result that is correct but written using powers of 4 (or 2) should be recognized, regardless of whether the final value is fully calculated.

## COUNTY COMPETITION IN MATHEMATICS

## 2nd grade - high school - B variant

## February 28, 2019.

## IF A STUDENT HAS A DIFFERENT APPROACH TO SOLVING THE TASK, THE COMMITTEE IS OBLIGED TO GRADE AND EVALUATE THAT APPROACH IN AN APPROPRIATE MANNER.