Oral, anal or vaginal and did you use condom? 12 weeks test window is a conservative guideline that have long been proven outdated - 4 is conclusive.
Your negative at 5th week with a 4th generation HIV test indicates that you don't have HIV.
P24 antigens are not "formed" it is a viral protein that makes up most of the viral core.
In case of infection, p24 antigen becomes detectable at approximately 10 days post exposure, peaks at about 16 days and then it fluctuates over the rest of the course of infection. Usually, after detectable amount of antibodies are formed the p24 antigen is no longer detected.
Average time to sero-convert is 21 days (3weeks). A week following sero-conversion, detectable amount of antibodies are almost always formed. Hence, at 28 days (4 weeks) most people that contracted the virus will start testing positive on a third generation antibody test.
A IV Gen test (p24 ag + III Gen AB Test) is an antibody and antigen sandwich that is recommended at 28th day for best result because if you have sero-converted, the antibody part of the test will yield a positive result. Or, if you are in delayed process of sero-conversion the p24 antigen part of the test will detect the antigen.
Therefore at 5 weeks, if you were actually infected antibodies must have been detected. It wasn't because you don't have the virus. Now, you can't transmit something that you don't posses.
It is often seen here that people who have cheated on their long term partners have been anxious and confused their guilt or fear with HIV ordeal, it is just how the mind processes your guilt. Fretting over this is not going to get you over this, making radical behavioural changes yourself can help, if you can't help your self, seeing a counselor is your next best option.
At this point, you don't have a concern that is specific to this forum as this forum only deals with HIV prevention information.