Writeup: Putnam 2007 A3
Problem Statement
Let be a positive integer. Suppose that the integers are written down in random order. What is the probability that at no time during this process, the sum of the integers that have been written up to that time is a positive integer divisible by ? Your answer should be in closed form, but may include factorials.
My Solution.
Note that if we work instead by removing numbers one by one from the end of this sequence, satisfying the indivisibility by condition is equivalent to satisfying the condition if we do it forwards.
Now note that the sum of all the numbers at the end of our process is trivially . So we can't write a number that is at the end, otherwise we would have written a number divisible by during the process. So we have to write erase a number that is either or at the end. We must eventually write that is . After we write this, our running sum is now , and we must erase a number that is either or at the end.
It's apparent from this that our sequence (writing backwards) must be of the form
with some sprinkled throughout.
Note that we have things that are , things that are , and things that are .
If we use stars and bars, we note that there are dividers and gaps in between the 's and 's (we can't put the .
So there are ways to disperse the 's among the sequence. Then, there are ways to permute the 's and ways to permute the 's and 's
So the total number of sequences satisfying the condition are
Divide this by sequences to get our probability,