Let be an odd integer. Determine all functions from the set of integers to itself such that for all integers and the difference divides .
Problem 1841
Official solution
Obviously, all functions in the answer satisfy the condition of the problem. We will show that there are no other functions satisfying that condition.
Let be a function satisfying the given condition. For each integer , the function defined by also satisfies the same condition. Therefore, by subtracting from we may assume that .
For any prime , the condition on with states that divides . Since the set of primes is infinite, there exist integers and with and such that for infinitely many primes we have . Denote the set of these primes by . Since a function satisfies the given condition if and only if satisfies the same condition, we may suppose .
The case is easily ruled out, because 0 does not divide any nonzero integer. Suppose and write as , where and are integers such that and . Let be an arbitrary integer. For each prime in , the difference divides . Using the equality , we get
Since we have , for large enough primes we obtain
Hence has to be zero. This implies and . Since is odd, we obtain .