Develop a test for divisibility of a positive integer n by 3 based on the binary expansion of n.

Solution:Step 1In this problem we have to develop a test for divisibility of a positive integer n by 3 based on the binary expansion of n.Binary representation of 3 is 011.Therefore if any integer is divisible by 3, then that integer will also be divisible by its binary representation that is 011.