Are there any status LEDs on the motherboard? What color are they, and are they flashing or solid? You should refer to your motherboard manual to see what they mean.
If you've already unseated and reseated all the cable connections as well as CPU and RAM, then it's time to check other components such as the power supply. Unplug the motherboard power cable and try the
paperclip test to see if the power supply can remain turned on by itself. If it also restarts every three seconds, then your PSU is defective.
The other culprit could be the motherboard. Please ensure that there is no damage to the CPU socket pins, especially if some pins may have been pushed out of alignment. The motherboard may also be defective. Unfortunately, that will be hard to check, but it is one of the possibilities if all other parts check out just fine.