yet another number game

I don’t understand the logic how ‘n%4 = 1’ works. can anyone explain me the logic in it pls?

I think it’s n%2 and to understand the logic, First consider small numbers like 1,2,3,4,5,…10 and apply the logic on these numbers.You will get to know after that.Still if you can not, comment below!

//