We need to gather more information.
If the CPU fan is running fast at start-up, it may be due to increased CPU temperatures. You could download, install, and run the free HWMonitor
. Keep it open on your Desktop and report CPU temp and fan speeds. See how the CPU temps and fan speeds increase with computing tasks.
The fan may be defective or maybe a wire is contacting the fan blades. This would require a look inside the tower. I would advise against this if the computer is still under warranty
; otherwise, have a look at the internal fans. Here is your HP Pavilion p6142p Desktop PC
service manual for reference.