Problem

NT-B2-M01-P014 A Cubic Restriction

#14 Grade 8 Grade 9 Grade 10 ★★★★☆ Level 4 of 5

Find all primes \(p\) such that \( \gcd(p^2+1,p^3+1)>1 \).