19. A bank issues ATM cards to its customers. Each card is associated with a password, which consists of 6 digits with no three consecutive digits being the same. It is known that no two cards have the same password. What is the maximum number of ATM cards the bank has issued?

A bank issues ATM cards to its customers. Each card is associated with a password, which consists of 6 digits with no three consecutive digits being the same. It is known that no two cards have the same password. What is the maximum number of ATM cards the bank has issued?
19. 963090
19. There are 1000000 possible 6-digit passwords, and we shall count how many of these have at least three identical consecutive digits. Let $A$ (resp. $B, C, D$) denote the set of passwords in which digits 1 to 3 (resp. 2 to 4, 3 to 5, 4 to 6) are identical. Then we have
$$
\begin{array}{l}
|A|=|B|=|C|=|D|=10 \times 10^{3}=10000 \\
|A \cap B|=|B \cap C|=|C \cap D|=10 \times 10^{2}=1000 \\
|A \cap C|=|B \cap D|=|A \cap D|=10 \times 10=100 \\
|A \cap B \cap C|=|B \cap C \cap D|=10 \times 10=100 \\
|A \cap B \cap D|=|A \cap C \cap D|=10 \\
|A \cap B \cap C \cap D|=10
\end{array}
$$

It follows that $|A \cup B \cup C \cup D|=10000 \times 4-(1000 \times 3+100 \times 3)+(100 \times 2+10 \times 2)-10$
$$
=36910
$$
and so the answer is $1000000-36910=963090$.