Step 1: Structure of account numbers.
Each account number is of the form:
\[
2 \; x_1x_2x_3x_4x_5x_6x_7
\]
where the first digit is always $2$, and $x_i$ can range from 0 to 9.
A number is ‘magic’ if:
- Case 1: $x_1x_2x_3 = x_4x_5x_6$, OR
- Case 2: $x_1x_2x_3 = x_5x_6x_7$, OR both.
Step 2: Case 1 — $x_1x_2x_3 = x_4x_5x_6$.
- $x_1x_2x_3$ can be any 3-digit string from 000 to 999.
- But “20000000” (all zeros) is invalid, so if $x_1x_2x_3 = 000$, then $x_7$ must not be 0.
Hence: $9$ possibilities for $x_7$.
- For each other $x_1x_2x_3$ ($001$ to $999$), $x_7$ can be $0$ to $9$ → 10 choices.
So, total = $9$ (for 000 case) + $999 \times 10 = 9990$ possibilities.
Step 3: Case 2 — $x_1x_2x_3 = x_5x_6x_7$.
- Again, $x_1x_2x_3$ ranges from 000 to 999.
- For $000$, $x_4$ cannot make “20000000” → 9 possibilities.
- For others (001 to 999), $x_4$ can be anything (0–9) → 10 possibilities.
So again, total = $9 + 999 \times 10 = 9990$ possibilities.
Step 4: Overlap of Case 1 and Case 2.
If both conditions hold, then:
\[
x_1x_2x_3 = x_4x_5x_6 = x_5x_6x_7
\]
That means $x_1x_2x_3 = x_4x_5x_6 = x_5x_6x_7$.
So, the last 6 digits are of the form $abcabc$.
There are 1000 such numbers (000000 to 999999).
But “20000000” is not valid, so exclude that.
So overlap = $999$ cases.
Step 5: Apply inclusion-exclusion.
\[
\text{Total magic} = 9990 + 9990 - 999 = 19989
\]
Final Answer:
\[
\boxed{19989}
\]