function p = power2(n)
   if n == 0
       p = 1;
   elseif mod(n,2)
       p = 2*power2((n-1)/2)^2;
   else
       p = power2(n/2)^2;
   end
end

