Most likely - Power Supply Unit
Next most likely - Motherboard
With this sort of problem you can't troubleshoot it execpt by changng parts.
I have seen a system problem like this, which turned out to be the Power Supply.
Fujitsu Lifebook P727 laptop review
Best of the Grad Shows 2017: University of the West of England (UWE)
Best value Mac: Which is the best £1249 Mac to buy
Les meilleures GoPro 2017