multiplication recursively in log time