Per the service manual 5 beeps indicates a memory issue.
They describe two very similar failure scenarios, with some basic troubleshooting tips:
Blank screen and the power LED flashes Red five times, once every second, followed by a two second pause, and the computer beeps five times. (Beeps stop after fifth iteration but LEDs continue flashing.) Cause Solution Pre-video memory error.
1. Reseat DIMMs. Power on the system.
2. Replace DIMMs one at a time to isolate the faulty module.
3. Replace third-party memory with HP memory.
4. Replace the system board.
Power LED flashes Red five times, once every second, followed by a two second pause, and the computer beeps five times. (Beeps stop after fifth iteration but LEDs continue flashing.) Cause Solution Memory is installed incorrectly or is bad. CAUTION: To avoid damage to the DIMMs or the system board, you must unplug the computer power cord before attempting to reseat, install, or remove a DIMM module.
1. Reseat DIMMs. Power on the system.
2. Replace DIMMs one at a time to isolate the faulty module.
3. Replace third-party memory with HP memory.
4. Replace the system board.