We need to determine all pairs (n,p) of positive integers such that:
- p is a prime,
- n>1,
- (p−1)n+1 is divisible by np−1.
1. **Case: p=2**
If p=2, then we need n∣1n+1=2. Since n>1, the only possible value for n is n=2. Therefore, (n,p)=(2,2) is a solution.
2. **Case: p is odd**
Let q be the smallest prime divisor of n and let o be the order of p−1modq. Since (p−1)2n≡1modq, we get o∣2n. By Fermat's Little Theorem, o∣q−1.
If o has a factor in common with n, this factor would be ≤q−1<q, which is impossible. Therefore, o∣2n reduces to o∣2, yielding (p−1)2≡1modq or equivalently q∣p(p−2).
- **Subcase: q∣p−2**
We get (p−1)n+1≡1n+1=2modq. But we need q to divide this number, thus q=2. However, this implies p is even, so p=2, which we excluded in this case.
- **Subcase: q∣p**
We write n=pks where p∤s and k>0. It is well known that for odd primes p, if vp(a−b)>0 and p∤a,b, then vp(at−bt)=vp(a−b)+vp(t) (where vp(m) is the p-adic valuation of m, the number of times m is divisible by p). With a=p−1, b=−1, and t=n, this gives us vp((p−1)n+1)=k+1 and it has to be ≥k(p−1) to enable pk(p−1)∣np−1∣(p−1)pks+1. Now k+1≥k(p−1)⟺2k+1≥kp⟺2+k1≥p. Since we assumed p≥3, we have k=1 and p=3.
If s=1, we have n=3 giving a solution. So let's assume s>1. Let q be the smallest prime divisor of s. By n=3, we want s∣9s2=n2∣2n+1=8s+1. Following the same idea as before, we take o as the order of 8modq and get again o∣2 by the same argument. In both cases, q∣82−1=63, thus q=7. But 8s+1≡1s+1=2mod7, which is a contradiction.
Conclusion: All solutions are given by (n,p)=(2,2),(3,3).
The final answer is (2,2),(3,3).