I would double check the cables. Sounds like the cable isn't in place correctly so sometimes it gets the signal while other times it doesn't.
If it was the cables why would it come back on instantly when I turn off the monitor and turn it immediately back on, only to have the screen go off again in a second or so. The power for the monitor doesn't go off when the screen goes off by itself, only when I cycle it off. Once the monitor is working correctly, it will hold the picture until I leave the computer idle for an hour or more. I'm thinking I have a bad monitor or bad video card. By the way this only happens to the right monitor, never on the left.