Solution:
Let $N$ be the total number of 6-digit sequences. A 6-digit sequence is a sequence of 6 digits where the first digit cannot be 0. So, the first digit has 9 choices (1-9) and the remaining 5 digits have 10 choices each (0-9).
$N = 9 \times 10^5$.
We are looking for the number of 6-digit sequences where a digit appears at least 5 times. This means the number of occurrences of some digit is either 5 or 6.
Case 1: Exactly one digit appears 6 times.
This means all 6 digits in the sequence are the same.
If the digit is '0', the sequence is '000000', which is not a 6-digit number.
So, the repeating digit must be 1, 2, ..., 9.
There are 9 such sequences: '111111', '222222', ..., '999999'.
Case 2: Exactly one digit appears 5 times.
Let the digit that appears 5 times be $d_1$, and the digit that appears once be $d_2$.
Here, $d_1 \neq d_2$.
Subcase 2.1: The digit $d_1$ appears 5 times, and $d_2$ appears once, and $d_1 = 0$.
If $d_1 = 0$, then the sequence has five '0's and one non-zero digit $d_2 \in \{1, ..., 9\}$.
The sequence must start with a non-zero digit to be a 6-digit number. This means the position of $d_2$ must be the first position.
So, the structure of the sequence is $d_200000$.
The possible values for $d_2$ are 1 to 9 (9 choices).
Number of sequences in this subcase: 9.
(e.g., 100000, 200000, ..., 900000)
Subcase 2.2: The digit $d_1$ appears 5 times, and $d_2$ appears once, and $d_1 \neq 0$.
The digit $d_1$ can be any of $\{1, ..., 9\}$ (9 choices).
The digit $d_2$ can be any of $\{0, ..., 9\}$ except $d_1$ (9 choices).
The position of $d_2$ can be any of the 6 positions.
Let's choose $d_1 \in \{1, ..., 9\}$ (9 ways).
Let's choose $d_2 \in \{0, ..., 9\} \setminus \{d_1\}$ (9 ways).
Now we need to place five $d_1$'s and one $d_2$. There are $\binom{6}{1} = 6$ ways to place $d_2$.
Now we need to consider the condition that the first digit is not 0.
Scenario A: The non-zero digit $d_1$ is at the first position.
In this case, the first digit is $d_1$. The remaining 5 positions have four $d_1$'s and one $d_2$.
The position of $d_2$ can be any of the 5 positions from 2 to 6.
Number of ways to choose $d_1$: 9 (from 1 to 9).
Number of ways to choose $d_2$: 9 (from 0 to 9, excluding $d_1$).
Number of ways to place $d_2$: 5 (positions 2 to 6).
Total sequences: $9 \times 9 \times 5 = 405$.
(e.g., if $d_1=1, d_2=2$: 121111, 112111, 111211, 111121, 111112)
(e.g., if $d_1=1, d_2=0$: 101111, 110111, 111011, 111101, 111110)
Scenario B: The digit $d_2$ is at the first position.
For this to be a valid 6-digit number, $d_2$ must be a non-zero digit.
So, $d_2 \in \{1, ..., 9\}$.
Number of ways to choose $d_1$: 9 (from 1 to 9).
Number of ways to choose $d_2$: 9 (from 1 to 9, excluding $d_1$).
The first position is $d_2$. The remaining 5 positions are all $d_1$'s.
There is only 1 way to place these digits.
Total sequences: $9 \times 9 \times 1 = 81$.
(e.g., if $d_1=1, d_2=2$: 211111)
Total sequences for Case 2.2: $405 + 81 = 486$.
Total number of sequences where a digit appears at least 5 times:
Sum of sequences from all cases:
Case 1 (6 times): 9 sequences (111111 to 999999).
Case 2.1 (5 zeros): 9 sequences (100000 to 900000).
Case 2.2 (5 non-zeros): 486 sequences.
Total = $9 + 9 + 486 = 504$.
Let's double-check the calculation using a different approach for combinations.
Let $S$ be the set of all 6-digit sequences.
Let $A$ be the set of sequences where some digit appears 6 times.
Let $B_d$ be the set of sequences where digit $d$ appears 5 times.
$|A|$: The sequences are $111111, 222222, \dots, 999999$. So $|A|=9$.
Consider a specific digit $k \in \{0, \dots, 9\}$ appearing 5 times.
This means the sequence has five $k$'s and one other digit $j \neq k$.
Let $N_k$ be the count of sequences where digit $k$ appears 5 times and some other digit $j \neq k$ appears once.
We must ensure the first digit is not 0.
If $k=0$: The sequence contains five 0s and one non-zero digit $j \in \{1, \dots, 9\}$.
For the sequence to be a 6-digit number, the first digit must be $j$.
So, it's $j00000$. There are 9 choices for $j$. ($100000, 200000, \dots, 900000$).
So $N_0 = 9$.
If $k \in \{1, \dots, 9\}$: The sequence contains five $k$'s and one digit $j \in \{0, \dots, 9\}$, $j \neq k$.
There are $\binom{6}{1}=6$ positions for $j$.
The number of choices for $j$ is 9 (since $j \neq k$).
Case $A_k$: $j$ is at the first position.
For this to be a 6-digit number, $j$ must be non-zero.
So $j \in \{1, \dots, 9\}$, $j \neq k$. There are 8 such choices for $j$.
The first digit is $j$, the rest are $k$. The sequence is $jkkkkk$. E.g., $211111$ for $k=1, j=2$.
Number of choices for $k$: 9. Number of choices for $j$: 8.
Total sequences for this case (first digit is $j \ne 0$): $9 \times 8 = 72$.
Case $B_k$: $k$ is at the first position.
The first digit is $k$ (which is non-zero). The remaining 5 positions include four $k$'s and one $j$.
The position of $j$ can be any of the 5 positions (2nd to 6th).
Number of choices for $k$: 9 (from 1 to 9).
Number of choices for $j$: 9 (from 0 to 9, $j \neq k$).
Number of positions for $j$: 5.
Total sequences for this case (first digit is $k \ne 0$): $9 \times 9 \times 5 = 405$.
Total number of sequences where exactly one digit appears 5 times:
Sum of $N_k$ over $k$:
$N_0 = 9$.
$N_k$ for $k \in \{1, \dots, 9\}$:
Sequences where $j \ne 0$ is first: 72. (e.g. $211111$ (k=1), $122222$ (k=2))
Sequences where $k \ne 0$ is first: 405. (e.g. $101111$ (k=1), $121111$ (k=1))
Total for exactly one digit appearing 5 times is $9 + 72 + 405 = 486$.
Total result is sum of sequences with 6 occurrences + sequences with 5 occurrences.
Result = $9 + 486 = 495$.
Let's re-verify the counting for "exactly one digit appears 5 times".
Let $S$ be a 6-digit sequence.
1. Choose the digit $d_1$ that appears 5 times. (10 choices, 0-9)
2. Choose the digit $d_2$ that appears 1 time. ($d_2 \neq d_1$, 9 choices)
3. Choose the position for $d_2$. ($\binom{6}{1}=6$ choices)
This gives $10 \times 9 \times 6 = 540$ arrangements of digits.
Now we need to consider the first digit constraint.
If the first digit is 0, these arrangements are not valid 6-digit numbers.
We need to subtract invalid sequences (those starting with 0).
An invalid sequence is of the form $0xxxxx$.
This implies the first digit is 0.
Case A: $d_1 = 0$. (Five 0s, one $d_2$)
The sequence contains five '0's and one $d_2 \in \{1, ..., 9\}$.
If the first digit is $d_2$, then $d_200000$. This is a valid 6-digit number.
There are 9 choices for $d_2$. These are $100000, 200000, \dots, 900000$.
If the first digit is $d_1=0$, then $0d_20000$ or $00d_2000$ etc. These are invalid numbers.
The first digit is 0. This means $d_2$ is in positions 2 to 6.
There are 5 positions for $d_2$.
There are 9 choices for $d_2$ (1-9).
So $1 \times 9 \times 5 = 45$ invalid sequences in this case. (e.g., 010000, 001000)
Case B: $d_1 \neq 0$. (Five $d_1$'s, one $d_2$)
$d_1 \in \{1, ..., 9\}$ (9 choices).
$d_2 \in \{0, ..., 9\} \setminus \{d_1\}$ (9 choices).
Total $9 \times 9 \times 6 = 486$ arrangements.
When is such an arrangement invalid? When the first digit is 0.
This means $d_2$ must be 0 and $d_2$ must be in the first position.
So, the sequence is $0 d_1 d_1 d_1 d_1 d_1$.
There is 1 way to place $d_2$ (at the start).
There is 1 choice for $d_2$ (it must be 0).
There are 9 choices for $d_1$ (1-9).
So $1 \times 1 \times 9 = 9$ invalid sequences in this case. (e.g., 011111, 022222)
Total invalid sequences: $45 + 9 = 54$.
Total arrangements of 5 $d_1$'s and one $d_2$ where $d_1 \ne d_2$: $10 \times 9 \times 6 = 540$.
Valid arrangements are $540 - 54 = 486$. This matches my previous count for case 2.
Now, let's look at the wording "A digit that appears at least 5 times".
This does not mean *exactly one* digit appears at least 5 times.
However, it's impossible for two different digits to appear at least 5 times in a 6-digit sequence.
E.g., if digit $A$ appears 5 times, that's $AAAAAx$. If digit $B$ appears 5 times, $BBBBBy$.
If $A \ne B$, then $A$ can appear at most 5 times and $B$ can appear at most 1 time ($x$ must be $B$ for $B$ to appear). So $A$ appears 5 times, $B$ appears 1 time.
If $A$ appeared 6 times, it would be $AAAAAA$. Then no other digit appears at all.
So, the condition "a digit appears at least 5 times" simplifies to:
(Exactly one digit appears 6 times) OR (Exactly one digit appears 5 times, and another digit appears 1 time).
So the calculation holds.
Number of sequences where one digit appears 6 times:
$111111, 222222, \dots, 999999$. This is 9 sequences. All are valid 6-digit numbers.
Number of sequences where one digit appears 5 times and another digit appears 1 time:
As calculated, this is 486 sequences. Each sequence has five of one digit ($d_1$) and one of another digit ($d_2 \ne d_1$).
These two sets of sequences are disjoint.
If a sequence consists of 6 identical digits, then no other digit appears. So it cannot have one digit appearing 5 times and another (different) digit appearing 1 time.
So, total count = (sequences with 6 identical digits) + (sequences with 5 identical digits of one kind, and 1 of another).
Total = $9 + 486 = 495$.
Let's carefully verify the validity of sequences once more.
Total possible arrangements of selecting $d_1$ (10 choices for digit that appears 5 times), $d_2$ (9 choices for digit that appears once), and placement of $d_2$ (6 choices): $10 \times 9 \times 6 = 540$.
From these 540 arrangements, which ones are NOT 6-digit numbers?
These are the ones that start with $0$.
So the first digit is $d_2=0$ (meaning $d_1 \ne 0$) OR the first digit is $d_1=0$.
Case A: $d_2=0$ (so $d_1 \ne 0$). The sequence starts with $0$.
The position of $d_2$ is the first one. So 1 choice for position.
$d_2$ must be 0. So 1 choice for $d_2$.
$d_1$ can be any of $\{1, ..., 9\}$. So 9 choices for $d_1$.
Example: $011111$, $022222$, etc.
Number of such invalid sequences: $1 \times 1 \times 9 = 9$.
Case B: $d_1=0$. The sequence contains five $0$s and one $d_2 \ne 0$.
If the sequence starts with $0$, then the first digit is one of the five $0$s.
The $d_2$ must appear in positions 2 to 6.
Number of positions for $d_2$ (2nd to 6th) is 5.
$d_2$ must be non-zero. So $d_2 \in \{1, ..., 9\}$. 9 choices for $d_2$.
The first digit is $d_1=0$.
Example: $010000$, $001000$, $000100$, $000010$, $000001$.
Number of such invalid sequences: $1 \times 9 \times 5 = 45$.
Total number of invalid sequences from the 540 arrangements: $9 + 45 = 54$.
So, number of valid sequences with exactly one digit appearing 5 times and another appearing once is $540 - 54 = 486$.
The sequences with a digit appearing 6 times are: $111111, 222222, \dots, 999999$. All 9 of these are valid 6-digit numbers.
The sets are indeed disjoint. A sequence like $111111$ has digit '1' appearing 6 times. No other digit appears.
A sequence like $111110$ has digit '1' appearing 5 times and '0' appearing once.
Thus, the total count is $9 + 486 = 495$.
Final verification of logic:
The question asks for "a digit that appears at least 5 times". This means there exists at least one digit $d$ such that count$(d) \ge 5$.
Let $S$ be a 6-digit sequence. The sum of counts of all digits is 6.
If count$(d) = 6$ for some $d$, then no other digit appears (count for other digits is 0). There are 9 such sequences (111111 to 999999) starting with a non-zero digit.
If count$(d) = 5$ for some $d$, then the remaining count is 1. This 1 must be for some other digit $d'$ (since counts must sum to 6 and $d$ already took 5, so $d'$ must be $\ne d$). So, one digit appears 5 times and one digit appears 1 time.
It's impossible to have two digits with count $\ge 5$. For example, if count(A) $\ge 5$ and count(B) $\ge 5$, then $A$ and $B$ must be different. Then total count is at least $5+5=10$, but the length is 6. This is a contradiction.
So, the problem asks for the size of the union of two disjoint sets:
1. Sequences where one digit appears 6 times.
2. Sequences where one digit appears 5 times, and another digit appears 1 time.
Calculations for set 1:
The sequence is $dddddd$. For it to be a 6-digit number, $d \in \{1, 2, ..., 9\}$. There are 9 such sequences.
Calculations for set 2:
Choose the digit $d_1$ that appears 5 times: 10 choices (0-9).
Choose the digit $d_2$ that appears 1 time: 9 choices (any digit except $d_1$).
Choose the position for $d_2$: 6 choices.
This gives $10 \times 9 \times 6 = 540$ theoretical arrangements.
We must exclude those that start with 0.
An arrangement starts with 0 if:
a) $d_2 = 0$ (and $d_1 \in \{1, ..., 9\}$) and $d_2$ is in position 1.
Value of $d_1$: 9 choices (1-9).
Value of $d_2$: 1 choice (0).
Position of $d_2$: 1 choice (position 1).
Number of such arrangements: $9 \times 1 \times 1 = 9$. (e.g., 011111)
b) $d_1 = 0$ (and $d_2 \in \{1, ..., 9\}$) and $d_1$ is in position 1.
Value of $d_1$: 1 choice (0).
Value of $d_2$: 9 choices (1-9).
Position of $d_2$: 5 choices (positions 2-6, as position 1 is $d_1$).
Number of such arrangements: $1 \times 9 \times 5 = 45$. (e.g., 010000)
Total invalid arrangements: $9 + 45 = 54$.
Number of valid sequences for set 2: $540 - 54 = 486$.
Total result: $9 + 486 = 495$.
The calculation appears solid.
The final answer is $\boxed{495}$.