A deterministic finite automaton is a tuple with finite state set , finite input alphabet , transition function , initial state , and accepting-state set . It accepts a word when the extended transition function of a deterministic finite automaton carries to a state in . A regular language is a language accepted by some deterministic finite automaton.
The pumping lemma for regular languages says that if a regular language is accepted by an automaton with states, every accepted word of length at least has a decomposition with , , and in the language for every . Indeed, among the states visited before and after the first symbols, two are equal by the pigeonhole principle. The intervening nonempty word labels a loop, which may be traversed any number of times without changing the final accepting state.
In base two, the powers of two have representations , so their language is the regular expression and is regular.
Suppose instead that their base-ten representations formed a regular language. Apply the pumping lemma to a sufficiently long decimal power of two , and put . Pumping gives decimal integers represented by , all powers of two. A direct place-value calculation shows that
for a constant independent of . The lengths, and hence the exponents in , tend to infinity. Dividing by gives
For large , the right side has absolute value less than one while the left side is an integer, so it must vanish. This would make a power of two equal to , impossible for by unique prime factorization. Thus the decimal powers of two are not a regular language.