private int fastSquareRec(int n, int leftToMultiply){
        if(leftToMultiply <= 0){
            return 0;
        }
        int k = 1; 
        int count=0;
        while(k <= leftToMultiply){
            k = k<<1;
            count++;
        }
        k = k>>1;
        count--;
        return (n<<count) + fastSquareRec(n, leftToMultiply- k);
    }
Start with 9,9. Then take 1 and keep left shifting 1 till you find number
less than 9 but power of 2. Then shift 9 by that many powers and repeat
the process with whatever is left between that number and 9.
src/com/interview/bits/SquareOfNumber.java