Remember this trick : while solving binary strings divisibility problem when interpreted as decimal number.
Divisor is d
If d is odd then d states are needed. i.e divisible by 3,5,7 will have 3,5,7 states
If di even then divide it by two till you get a odd number(say x). So No. of states = x + number_of_times_divided_by_2
Eg:
12 --> (12/2),(6/2),3 (stop odd number has come) = 3+1+1 =5 sates
18 -->(18/2),9 = 9+1 = 10 states