@gf_256 A number is divisible by 3 if and only if the sum of its digits is divisible by 3. Hence, a DFA can be created representing mod 3 with q0 being = 0 mod 3, q1 = 1 mod 3, q2 = 2 mod 3 and transitions created for every digit. q0 is the accepting state