What you will actually do, is to write out the string representation of a number in base 4.
We do know that if you divide the number with 4, then the remainder has value in range [0..3] and is the least significant digit. On the other hand, normal integer division by 4 produces a number too.
Say 7. 7/4=1. 7%4=3. 4*1 + 3 = 7.
Too easy?
Take 17. 17/4=4. 17%4=1. But 4/4=1 and 4%4=0. Thus, 4*4*1+4*0+1=17.