2023 SSMO Team Round Problems/Problem 4

Problem

Find the sum of values for prime $p$ such that $p \mid (2023^{p^2}+(p-1)!+2^{p^4}).$

Solution