DFA · Regular
Lengths divisible by 2 or by 3
A unary language is ultimately periodic. Here the period is lcm(2, 3) = 6: a ring of six states, four of them accepting — 0, 2, 3 and 4.
The author’s examples, run
ε → acceptaa → acceptaaa → acceptaaaaaaaaaaaaaa → accepta → rejectaaaaaaaaaaaaa → rejectaaaaa → rejectaaaaaaa → reject