This is a regular language. A deterministic finite automaton needs only to remember the number of consecutive trailing ones, up to three, and whether a forbidden run of four has already occurred. Use states , start at , and accept in . Its transition function of a finite automaton is:
| State | On | On |
|---|---|---|