12. (2004 Czech and Slovak Mathematical Olympiad) Find the positive integer , such that is an integer.
Problem 659
Official solution
12. When , the sums are , respectively, which are integers.
When ,
For it to be an integer, the numerator must be divisible by , so must be divisible by , which means must be divisible by . Therefore, , which is impossible.
Thus, the sum is an integer if and only if .