Problem:
Let be a graph whose vertices are the integers. Assume that any two integers are connected by a finite path in . For two integers and , we denote by the length of the shortest path from to , where the length of a path is the number of edges in it. Assume that for all and define . Find all possible sets .
Solution
Solution:
The possible sets are and .
Since is defined as a distance, we also have the triangle inequality, stating that
for all . Now note that for all we must have and thus . Iterating this result with the triangle inequality we find that for all . If we consider the graph on where are connected if and only if , then we have which satisfies the condition. Excluding this case, we can assume without loss of generality that for some positive integer , after shifting accordingly. Moreover, we can assume that is the smallest positive integer with this property. If , then we would have
contradicting minimality of . Hence, . But we must also have , which together with implies that . Putting the two inequalities together we find that , which is equivalent to . In particular, we have
and hence . Since for all integers we have
and similarly , it follows that for all . Now note that for all we have
and similarly . It follows by induction that , where the base case is trivial and we use the fact that is coprime to 2 and 3. Now since each integer is at most distance 2 from an integer of the form , it follows that for all .
Now set and note that certainly . If , then we must also have since any shortest path of length 3 can be shortened to a shortest path of length 2. The only remaining possibilities for are
Now consider the graph where and are connected if and only if
and a quick check shows that this graph satisfies the condition and . Considering instead the graph where and are connected if they are of different parity, we also check that the condition is met and . Finally considering the complete graph on also shows that is possible.