Thanks for posting your question on Justanswer.com, a global paid independent support site.My Name is ***** ***** I will be assisting you today. The problem you are facing can be caused by few reasons.
1. If the main board is defective.
2. If the power socket is defective.
3. If some spares are damaged.
Now, try to unplug the printer for 10 mins. and then check the issue. If the problem persists then, unfortunately, either the board is defective or some spares are defective. But, from your description, if seems the board is defective. this can happen when some capacitors on the board do not get charged when you power on the printer and in that case, there are only two options left to solve this problem. One is repairing the printer or two replacing the mainboard.
Now, the better option is replacing the printer instead of replacing the board, because the cost of the replacement if more than the price of a new printer. If the printer is less than 3 years of then, you can go the repairing option, because that can save you some money. If the printer is less than one year or has any extended warranty then, you can get it replaced from HP free of cost. Let me know, if you need any further information otherwise please remember to give a positive rating, as that is the only way I am compensated for my time and effort.