This is an old question, but here's my less rigorous proof:
Given a wff:
- Inserting $\lnot$, will always add 3 characters: e.g $\dots (a \land b) \dots \to \dots (a \land \color{red}{(\lnot b)}) \dots$
- Inserting $\Box$ (any binary operator), will always add 4 characters: e.g $\dots (a \land b) \dots \to \dots (a \land \color{red}{(b\ \Box\ c)}) \dots$
The smallest expression we can ever have is a sentence symbol itself, so the possible lengths must be:
$$1 + 3a + 4b, \text{ where } a, b \in \mathbb{N}$$
We temporarily ignore the $1+$ and focus on $3a + 4b$ only.
We make a table where the first row is $3a$, and the first column is $4b$, and their intersections as their sums:
$$
\begin{bmatrix}
0 & 3 & 6 & 9 & \dots \\
4 &4+3 &4+6 & \dots\\
8 &8+3 & \ddots\\
12 & \vdots \\
\vdots
\end{bmatrix}
\to
\begin{bmatrix}
0 & 3 & 6 & 9 & \dots\\
4 & 7 & 10 & 13 \\
8 & 11 & 14 & \\
12 & 15 & & \ddots \\
\vdots & & & &
\end{bmatrix}
\to
\begin{bmatrix}
0 & 3 & \color{red}{6} & \color{blue}{9} & \dots\\
4 & \color{red}{7} & \color{blue}{10} & \color{red}{13} \\
\color{red}{8} & \color{blue}{11} & \color{red}{14} & \\
\color{blue}{12} & \color{red}{15} && \ddots \\
\vdots
\end{bmatrix}
$$
We notice all numbers $\geq$ 6 are in the table (colored $\color{red}{\text{red}}$ & $\color{blue}{\text{blue}}$). This means $3a + 4b$ can equal: $0, 3, 4, 6, 7, 8 \dots$ but not $1, 2, 5$
Since we had $1 + 3a + 4b$, we just add 1 and the numbers it can't equal and we get: $2, 3, 6$.