The research focused on predicting second primary cancers in patients who had previously had cancer. Among 81,175 cancer patients, 56 pairs of first and second cancers were identified, with 22 of them showing higher incidence than the standard SEER registry rates. Even after accounting for known risk factors, elevated risk persisted, including in established hereditary cancer pairs such as breast and ovarian cancers. The research team created machine learning models that combined rare genetic variants, polygenic risk scores, treatment exposure, and demographic factors. These models accurately predicted second primary ovarian and pancreatic cancers in breast and prostate cancer survivors during 15-year follow-up with an accuracy of AUC 0.70. This framework enables individualized risk estimation and improved targeted surveillance in the growing population of cancer survivors.