1. $204 a_{1}, a_{2}, \cdots, a_{n}$ is a sequence, for each $k, 1 \leqslant k \leqslant n, a_{k} \in$ $\{0,1\}$. If $a_{k}, a_{k+1}$ are the same, let $b_{k}=0$; if $a_{k}, a_{k+1}$ are different, let $b_{k}$ $=1$, thus obtaining a new sequence $b_{1}, b_{2}, \cdots, b_{n-1}, b_{k} \in\{0,1\}$, where $k=1,2$, $\cdots, n-1$. Repeating this operation, a triangular number table composed entirely of the digits 0 and 1 is formed, with the last row containing only one digit. Find the maximum value of the sum of 1s in this triangular number table composed of digits.
[Solution] Let $x_{n}$ denote the maximum value sought.
Obviously, $x_{1}=1, x_{2}=2$.
When $n=3$, the first row $a_{1}, a_{2}, a_{3}$ has only 8 possibilities, so there are only 8 different number tables. They are:
The sums of 1s in these number tables are $3,4,4,4,3,3,3,0$. Therefore,
$$
x_{3}=4 \text {. }
$$

Now we seek the relationship between $x_{n}$ and $x_{n+3}$.
Consider a triangular number table with $n+3$ rows, whose first three rows are
$\begin{array}{llllllll}a_{1} & a_{2} & a_{3} & \cdots & a_{n} & a_{n+1} & a_{n+2} & a_{n+3}\end{array}$
$\begin{array}{lllllll}b_{1} & b_{2} & b_{3} & \cdots & b_{n} & b_{n+1} & b_{n+2}\end{array}$
$\begin{array}{llllll}c_{1} & c_{2} & c_{3} & \cdots & c_{n} & c_{n+1}\end{array}$

Divide the above $3 n+6$ numbers into $n+2$ triplets:
$\left\{a_{i}, b_{i}, c_{i}\right\}(i=1,2, \cdots, n+1) ;\left\{a_{n+2}, b_{n+2}, a_{n+3}\right\}$.
If a triplet $\left\{a_{k}, b_{k}, c_{k}\right\}$ contains at least one zero, it is called a zero-containing triplet. If a triplet $\left\{a_{k}, b_{k}, c_{k}\right\}$ is all 1s, where $k \leqslant n$, then $a_{k+1}=0, b_{k+1}=0$, thus the two triplets $\left\{a_{k}, b_{k}, c_{k}\right\}$ and $\left\{a_{k+1}, b_{k+1}, c_{k+1}\right\}$ on average contain at least one zero, and are called average zero-containing triplets. If $\left\{a_{n+1}, b_{n+1}, c_{n+1}\right\}$ is all 1s, then $a_{n+2}=0, b_{n+2}=0$, thus $\left\{a_{n+1}, b_{n+1}, c_{n+1}\right\}$ and $\left\{a_{n+2}, b_{n+2}, a_{n+3}\right\}$ are two average zero-containing triplets. If $\left\{a_{n+1}, b_{n+1}, c_{n+1}\right\}$ is a zero-containing triplet, then $\left\{a_{n+2}, b_{n+2}, c_{n+3}\right\}$ must be a zero-containing triplet. Therefore, starting from the first triplet $\left\{a_{1}, b_{1}, c_{1}\right\}$, and considering the number of zeros one by one, from the above analysis, we know that among the $3 n+6$ numbers in the first three rows, there are at least $n+2$ zeros, thus at most $2 n+4$ ones, hence
$$
x_{n+3} \leqslant x_{n}+(2 n+4) \quad(n \in N) .
$$
(1)

In the above inequality, let $n=3(k-1), 3(k-2), \cdots, 6,3$, respectively, we get
$x_{3 k} \leqslant x_{3(k-1)}+6(k-1)+4$,
$x_{3(k-1)} \leqslant x_{3(k-2)}+6(k-2)+4$,
.....
$x_{9} \leqslant x_{6}+6 \cdot 2+4$
$x_{6} \leqslant x_{3}+6 \cdot 1+4$.

Adding the $k-1$ inequalities obtained, and noting that $x_{3}=4$, we get
$$
\begin{array}{l} 
x_{3 k} \leqslant 6[1+2+\cdots+(k-2)+(k-1)]+4 k \\
=k(3 k+1) . \\
\text { In (1), let } n=3(k-1),3(k-2), \cdots, 6,3, \text { respectively, we get } \\
x_{3 k+1} \leqslant x_{3 k-2}+6 k \\
x_{3 k-2} \leqslant x_{3 k-5}+6(k-1) \\
\cdots \cdots \\
x_{7} \leqslant x_{4}+6 \cdot 2 \\
x_{4} \leqslant x_{1}+6
\end{array}
$$

Adding the $k$ inequalities obtained, and noting that $x_{1}=1$, we get
$$
\begin{aligned}
x_{3 k+1} & \leqslant 6(1+2+\cdots+k)+1 \\
& =3 k(k+1)+1 .
\end{aligned}
$$
$$
\begin{array}{l}
\text { In (1), let } n=3 k-1,3 k-4, \cdots, 5,2 \text {, respectively, we get } \\
x_{3 k+2} \leqslant x_{3 k-1}+6 k+2, \\
x_{3 k-1} \leqslant x_{3 k-4}+6(k-1)+2,
\end{array}
$$
```
.....
```
$$
\begin{array}{l}
x_{8} \leqslant x_{5}+6 \cdot 2+2, \\
x_{5} \leqslant x_{2}+6 \cdot 1+2 .
\end{array}
$$

Adding the $k$ inequalities obtained, and noting that $x_{2}=2$, we get
$$
\begin{aligned}
x_{3 k+2} & \leqslant 6(1+2+\cdots+k)+2(k+1) \\
& =3 k(k+1)+2(k+1) \\
& =(k+1)(3 k+2) .
\end{aligned}
$$

Combining (2), (3), and (4) into one formula, we get
$$
x_{n} \leqslant\left[\frac{n(n+1)+1}{3}\right], n \in N,
$$

where $\left[\frac{n(n+1)+1}{3}\right]$ denotes the greatest integer not exceeding $\frac{n(n+1)+1}{3}$ (clearly, (5) holds for $n=1,2,3$ as well).
The following example shows that the number on the right side of (5) can be achieved.
We look at this example number table in reverse. Counting from the bottom, every three rows form a group.
Let the $k$-th group be the $(3 k-2)$-th row from the bottom, the $(3 k-1)$-th row from the bottom, and the $(3 k)$-th row from the bottom, then on the $(3 k-2)$-th row from the bottom, write "1,0,1" repeatedly; on the $(3 k-1)$-th row from the bottom, write "0,1,1" repeatedly; on the $(3 k)$-th row from the bottom, write "1,1,0" repeatedly, until the number of numbers to be written in each row is reached.
When $n=3 k$, the number of 1s in this number table is
$$
\begin{aligned}
& (1+1+2)+(3+3+4)+(5+5+6)+\cdots+[(2 k-1)+(2 k \\
& +1)+2 k] \\
= & 2 k^{2}+k(k+1)=(3 k+1) k .
\end{aligned}
$$

When $n=3 k+1$, i.e., adding the first row (i.e., the $n$-th row from the bottom) to the above number table for $n=3 k$, this row is obtained by repeatedly writing "1,0,1", so the number of 1s in this row is $2 k+1$, thus the number of 1s in the number table for $n=3 k+1$ is
$(3 k+1) k+2 k+1=3 k(k+1)+1$.
When $n=3 k+2$, the first row is obtained by repeatedly writing "0,1,1", so the number of 1s in this row is $2 k+1$, and the total number of 1s in the number table is
$[3 k(k+1)+1]+(2 k+1)=(k+1)(3 k+2)$
In summary, we have given an example of a number table that satisfies
$$
x_{n}=\left[\frac{n(n+1)+1}{3}\right] \quad n \in N
$$

Therefore, the maximum value sought is
$$
x_{n}=\left[\frac{n(n+1)+1}{3}\right], n \in N
$$