>>12749856I'm going to assume the alphabet is {a, b} and that n_a(w) and n_b(w) mean, respectively, the number of a's and b's in w.
In this case we want to recognize a string if the difference between its number of a's and b's is 1 mod 3. Intuitively, if we have a substring w whose difference of a's and b's equals x, then if we read an 'a', the difference will be x+1 mod3 ; if we read a 'b', the difference will be x-1 mod3.
Therefore, design a DFA with 3 states, corresponding to 0, 1 and 2, with the start state on 0, and the end state on 1. The transition between the state is straightforward: if you're in state 0 and read an a, go to state 1 ; if you're in state 1 and read an a, go to state 2; if you're in state 2 and read an a, go to state 0. For b, the transitions are similar but in the opposite direction.
Take my post with a grain of salt, it's been a while since I worked on this stuff, and I'm not even sure I understood the question's notation correctly.