MathLabs

Problem 3

Determine all pairs (p,n), where p is a prime number and n is a positive integer, for which (n^p+1)/(p^n+1) is an integer.
Step 6 of 7: Get the reverse bound
n2≡1(modp+1)⟹np=n2⋅((p−1)/2)+1≡n≡−1(modp+1),p+1∣n+1.n^2\equiv1\pmod{p+1}\Longrightarrow n^p=n^{2\cdot((p-1)/2)+1}\equiv n\equiv-1\pmod{p+1},\quad p+1\mid n+1.
Detailed analysis

Because p is odd, n^p≡n modulo p+1 when n²≡1. Comparing with n^p≡−1 gives p+1|n+1. Since n≤p, this divisibility forces n+1≤p+1, while p+1 divides n+1; hence n=p.