function nbase4 = base4(digits, n)
nbase4 = zeros(1,digits);
for k=1:digits
 nbase4(k) = mod(n,4);
 n = (n - nbase4(k)) / 4;
end

