= Solution
The <pumping lemma for regular languages> states that if $L$ is regular, then some $p\geq1$ has the following property: every $w\in L$ with $|w|\geq p$ can be written $w=xyz$ with $|xy|\leq p$, $|y|\geq1$, and $xy^iz\in L$ for every $i\geq0$. Indeed, while a deterministic finite automaton with $p$ states reads the first $p$ symbols, two of the first $p+1$ visited states coincide; the intervening nonempty loop may be traversed any number of times.
The language $\{0^{n^2}1:n\geq0\}$ is not regular. If its pumping length were $p$, apply the lemma to $w=0^{p^2}1$. The pumped block is $y=0^r$ for some $1\leq r\leq p$. Pumping once more gives $p^2+r$ zeros, but
$$
p^2<p^2+r<(p+1)^2,
$$
so their number is not a square.
Back to article page