You are absolutely correct with your diagnoses.
Bad Power Supply. Weak voltage power rail.
The power outage may, or may not have caused the Power Supply to fail, it may have just aggravated the situation. The Power Supply may have been close to failing.
Supporting data:
1) A bad Power Supply is one of the leading causes of computer failure. Close to 80 percent. Quite common.
2) Coming in at number 2 is the computer is dirty inside, as well as the Power Supply.
A Power Supply for today's PC computers is an SMPS.
Switched-Mode Power Supply,
http://en.wikipedia.org/wiki/Switched-mode_power_supplyClick on the photo to the upper right.
(You can click on the photo again to enlarge. You can enlarge twice)
The cooling components for an SMPS are it's internal Fan, and Heatsinks used inside.
Typical construction of a Heatsink is a plate of metal with tall, thin fins protruding from it.
The plate of metal absorbs heat from whatever object it is placed against, and the tall, thin fins absorb heat from the plate.
The fins radiate the heat away. (Much like an automobile radiator, and steam radiators used in homes/businesses)
The fan pushes air in-between the fins, and around the fins, and helps to carry the heat away.
(There are two Heatsinks shown in the photo's example.
They are in-between B and C, and C and D.
The Heatsink's resemble aluminum 'Lincoln Logs')
When the cooling components for the SMPS become clogged with 'Gunk', the cooling capacity drops tremendously.
(Gunk = Dirt, dust, etc)
The Power Supply overheats.
Heat = Wasted Energy
The Power Supply strains to keep up with the call for power, but eventually cannot, and fails.
(Components inside the power supply fail)
I believe with your scenario the Power Supply is dirty inside, and was on the verge of failing soon.
The power outage caused a voltage spike, and aggravated the situation causing the Power Supply to fail.
Depends on what country you are in, but if you are in a country that uses 120 Volts AC, (USA), the utility company is allowed to provide 108 to 127 Volts.
Country using 220 Volts AC?
208 to 227 Volts.
When the power went off, there could have been a voltage spike that exceeded way beyond the maximum allowed.
No, unfortunately a utility company cannot be held responsible. :(
Solution?
Replace the Power Supply.
1) HP Support > Pavilion a815n desktop computer > Main support page,
http://h10025.www1.hp.com/ewfrf/wc/product?product=445595&lc=en&cc=us&dlc=en&submit.y=5&submit.x=6&lang=en&cc=us
Click on Product information > Product specifications > Motherboard Specifications, PTGD1-LA (Goldfish)
Scroll down towards the bottom of the page to view the motherboard illustration and photo.
Power Supply power cable requirements and added info on the power cable connectors:
A) Looking at the motherboard illustration view the right side. Find the > ATX Power Connector
Match it to the area on the motherboard photo.
White connector with 24 socket holes. Two columns of 12 holes.
You need a Power Supply with a 24-pin ATX main power cable,
http://www.playtool.com/pages/psuconnectors/connectors.html#atxmain24There is a Lock on the side of the connector (Male) with the wires coming into.
There is a Lock tab on the side of the connector (Female) on the motherboard.
The Top of the Lock on the male connector is squeezed in.
The Lock works on the same principle as a See-Saw on a playground.
Squeezing the top of the Lock IN, brings the Lock's tang away from the Lock Tab on the motherboard connector.
Then the Male connector can gently be wiggled, and removed from the Female motherboard connector.
(Caution! Do Not pull on the wires. Pull Only on the connector)
This also applies to the connector below.
B) View the motherboard illustration to the Left side.
To the left of the large square block with > Intel i915 GCMH is a smaller square with > ATX12V
Match this to the motherboard photo.
It is a white square connector with 4 socket holes, to the bottom left of the Processor socket.
You need a 4-pin ATX +12 Volt power cable,
http://www.playtool.com/pages/psuconnectors/connectors.html#atx12v4C) The Power Supply will also need a SATA power cable for the SATA harddrive,
http://www.playtool.com/pages/psuconnectors/connectors.html#sataIF, the SATA harddrive has connectors for a SATA power cable, AND a 4-pin Standard Peripheral power cable, ONLY USE THE SATA power cable.
If you use both you will burn up the SATA harddrive. Sometimes not all at once, but down the road it will.
D) The Power Supply will also need enough 4-pin Standard Peripheral power cables, for the optical drive/s, (CD/DVD drive), and any computer case fans which require this type of power cable.
http://www.playtool.com/pages/psuconnectors/connectors.html#peripheral(NOTE*
In the photos an IDE (PATA) harddrive is shown. Your harddrive is a SATA unit. Does NOT require this power cable)
The power cables shown as standard for Power Supply's being sold today.
I wanted to show you what they looked like, and information on the connectors.
If you go back to the Main support page, click on Manuals, then in the list click on > Part Replacement Instructions, you will have a pictorial guide in opening the computer case, and how to replace the Power Supply.
It is a PDF file. Allow up to at least 30 seconds before you see the first page. It may take additional time for the file to fully download.
(Took 2 seconds to see the first page. The first page is blank. Took an additional 47 seconds to fully download. Using a medium speed DSL connection)
Replacing the Power Supply, and opening the computer case - Page 31.
(I would suggest reducing the view to 100 percent. Click on the Zoom Out icon at the top of the PDF file.
{ - }
If you have additional questions regarding the above, or need guidance in choosing a decent, affordable Power Supply, please post in a Comment.
Apologize for the length of this solution, but I feel it's better than stating, "Replace the Power Supply"
Regards,
joecoolvette