for n=0to 104a=0 for i=0to 9a=a+3^i*mod(int(n/2^i),2)next ?a next