Sketch won't start

When I upload a sketch to my Arduino UNO r3, the sketch works fine. But as soon as I disconnect the usb cable and reconect it (or use a wall adapter) the L led (pin 13) then keeps flashing 3 times then off, then it repeats the 3 flashes indefinitely.

Ensure the ATmega328P processor is well seated in the socket.