Divisible by n , so there should be n states starting from 0 to (n-1).
let's take m % n = 0 , where m is the input number .
so , the final state should be 0 .( as remainder in 0 )
For the number being divisible by 0 , the numbers can be { 0 , 10 , 100 , 110 , 1000 , 1010 .... }
So , the minimal DFA will be :
Similarly in the same manner DFA for binary number divisible by 3 will be :
Now , let's see another type of question where remainder is not zero , like find all binary numbers which when divided by 2 produces remainder 1.
So , here the number of states will be 2 , Remainder is 1 , so final state will be 1.
So , in the same way you can draw DFA for any divisiblity problem