led matrix - problem with the corner leds

I think the pow() function produces a floating-point result which may give you 1.9999 instead of 2. When you subtract the integer 1 it converts 1.99999 to the integer 1 and ten subtracts 1 to get 0.

Try using the shift operator instead of the pow() function:

for (int i=1;i<9;i++){
     lc.setRow(0,1,(1<<i)-1);
     delay(300);
   }