We are asked to find all positive integers m such that there exists a prime number p for which nm−m is not divisible by p for any integer n.
We claim that the answer is all m=1.
First, consider m=1. In this case, the expression becomes n−1, which can clearly be a multiple of any prime p by choosing n≡1(modp).
Now, consider m>1. Let p be an arbitrary prime factor of m. Write m=pkl, where gcd(l,p)=1. Assume that no prime q exists such that nm−m≡0(modq) has no solution for n.
Consider the expression (pkl)p−1+(pkl)p−2+⋯+pkl+1. Since the left-hand side is not congruent to 1(modpk+1), we can choose q such that q≡1(modpk+1). We will show that this q leads to a contradiction.
First, note that the remainder of mp−1+mp−2+⋯+1 when divided by m−1 is p, which is relatively prime to m−1=pkl−1. Thus, gcd(q,m−1)=1, so m≡1(modq).
Since nm≡m(modq), we have npkl≡pkl(modq), so npk+1l≡(pkl)p≡1(modq). Let the order of n(modq) be x. This means x∣pk+1l. However, since npkl≡pkl(modq), which is not congruent to 1(modq), we have that x is not a factor of pkl, so pk+1∣x∣(q−1), implying q≡1(modpk+1), which is a contradiction.
Thus, there exists a prime q such that q is not a factor of nm−m for all integers n.
The answer is: m= 1}.