Its the RAM! Happened many times with my old pc cuz it had no sidepanel and dust got in it a lot.
Remove the ram sticks, take a brush clean the ram slots, get an eraser and rub the ram´s connectors (golden bits) and then reseating them again should work.
hm try with 1 ram stick at a time on all the slots and see if it works.