Let $\mathcal{L_0}$ be the smallest set $L$ of finite sequences of $\textit{logical symbols}= \{(\enspace)\enspace\neg\}$ and $\textit{propositional symbols}=\{A_n|n\in\mathbb{N}\}$ for $n \in \mathbb{N}$ satisfying the following properties:
(1) For each propositional symbol $A_n$ with $n\in\mathbb{N}$, \begin{multline} A_n \in L. \end{multline}
(2) For each pair of finite sequences $s$ and $t$, if $s$ and $t$ belong to $L$, then \begin{multline} (\neg s) \in L \end{multline} and \begin{multline} (s \to t) \in L. \end{multline}
For which natural numbers $n$ are there elements of $\mathcal{L_0}$ of length $n$?
The smaller lengths $1,4,5$ are the basic forms, which are obvious:
(a) $n=1$: The atom $A_i$
(b) $n=4$: $(\neg A_i)$
(c) $n=5$: $(A_i \to A_j)$
Note we can't have length $0$, it wouldn't be an element of $\mathcal{L_0}$. Can't have $2$ or $3$ or $6$ since the above are the most basic elements, and we can't increase an element by anything other than three or four.
Now we seek the next possible values of $n$. We can take our basic forms (b) and (c) and increase them by the lowest possible counts of three or four by repeatedly surrounding them, represented here by $x$, by $(\neg x)$or $(x\to A_i)$, which will give an element of $\mathcal{L_0}$ in the form of (2) or (3). Call these operations $\delta$ and $\gamma$ respectively.
$\delta$ surrounds element with $(\neg \enspace\enspace )$.
$\gamma$ surrounds element with $(\enspace\enspace\to A_i)$.
This gives us the result:
Start with (b). We have a length four element. apply $\delta$ repeatedly. This gives
$n = 7,10,13,16,19,22...$
Now, instead apply $\gamma$ to (b) repeatedly. This gives
$n = 8,12,16,20,24...$
Now for (b) apply $\delta$ first, then $\gamma$. We get
$n=7,11$
Note now that we have $10,11,12$ in succession. We see we can use $\delta$ to increase any of these by three, which implies $n\geq 10$, meaning we can achieve any value for $n$ equal to or beyond $10$.
We showed above that sequences of length $7$ and $8$ exist. All that remains is to find a sequence of length $9$. This is done by applying $\gamma$ to (c). $5+4=9$.
So therefore $\{n=1,4,5 \lor n\geq 7|n \in \mathbb{N}\}$.