Editorial
Need a hint? Checkout the editorial.
View Editorial
Editorial
If $ p=2 $ then $ p+2=4 $ and $ p^{2}+2p-8=0 $. So $ p=2 $ is not a solution.
If $ p=3 $ then $ p+2=2 $ and $ p^{2}+2p-8=0 $. So $ p=3 $ is a solution.
Now, assume $ p> 3 $, so $ p $ is odd.
We consider two cases :
- Case 1 : $ p\equiv 1 (mod3) $
So $ p+2\equiv 0(mod3) $ , contradiction.
- Case 2 : $ p\equiv 2(mod3) $
So $ 2p\equiv 1(mod3) $, and we know that $ p^{2}\equiv 1(mod3) $ because $ p $ is odd.
So $ p^{2}+2p-8\equiv 0(mod3) $ , contradiction again.
Now solve these cases!