Does it do the same if you connect to mains electricity?
Sometimes, but not always, it could point to a memory failure. On the underside of the machine there should be a removeable hatch about two inches by one. Unscrew that and the RAM stick(s) are inside.
If you have more than one, remove one of them, power up and see if that stops the bad behaviour. If it doesn't remove the other and put the first on back.