Problem:
Let . Compute the number of ways to partition into 16 arithmetic sequences such that each arithmetic sequence has length 4 and common difference 1, 4, or 16.
Solution
Solution:
The key observation is the following:
Claim 1. No partition can contain all three common differences.
Proof. Indeed, suppose the sequences and are both present for some and in . Without loss of generality, assume ; otherwise, we can take our partition and replace each number with , resulting in the sequence instead.
Note that , as otherwise one of , or would be equivalent to modulo 16 and the two sequences would intersect.
Hence, there exists a number strictly between and which is equivalent to modulo 4. The same argument above tells us cannot be in a difference-4 sequence; it also cannot be in a difference-1 sequence, as such a sequence would contain either or . Thus is in a difference-16 sequence. Similarly, as lies between and , and lies between and , both and are in difference-4 sequences.
Since we assumed , we know . Note that cannot be part of a difference-16 sequence, as such a sequence would also contain . Furthermore, lies between and , both of which are in difference-4 sequences; hence, cannot be part of a difference-1 sequence. Thus is in a difference-4 sequence. This sequence must contain either or both and .
If the sequence contains , then since lies strictly between and , the same argument as before tells us is in a difference-16 sequence. If the sequence contains and , then lies strictly between the two, so is in a difference-16 sequence; this sequence contains . In either case, is in a difference-16 sequence.
Now, we know , and are all in difference-16 sequences. These sequences contain all 16 numbers in the same residue class as modulo 4. Any difference-1 sequence would have to contain a value in this residue class; thus, no difference-1 sequences can be present.
We casework on which types of sequences are present.
Case 1: Only sequences of common difference 1 and 16 appear.
Observe that each sequence of common difference 1 has one number of each residue class modulo 4, while each sequence of common difference 16 has four numbers in the same residue class. Since has an equal number of elements in each residue class, there must be an equal number of difference-16 sequences in each residue class, so the number of difference-16 sequences is a multiple of 4. Say there are of them.
Then, among the numbers 1 through 16, there are of them that lie in difference-16 sequences, so the remaining lie in difference-1 sequences.
Conversely, if we are given how the numbers from 1 through 16 are split between difference-1 and difference-16 sequences, we can uniquely recover the whole partition on . Indeed, the difference-16 sequences are fixed, which in turn fixes the difference-1 sequences.
Thus, the number of sequences in this case is the number of ordered partitions of 16 into 1's and 4's, which is . Summing over all , the total for this case is
Case 2: Only sequences of common difference 4 and 16 appear.
Within the multiples of 4, any difference-4 and difference-16 sequence intersect, so the 16 multiples of 4 must be covered with either four difference-4 sequences or four difference-16 sequences. The same goes for each residue class mod 4, and we can make each choice independently. Thus the number of partitions in this case is .
Case 3: Only sequences of common difference 1 and 4 appear.
Observe that if and are in a difference-4 sequence, then , and must also be in difference-4 sequences, so the difference-4 sequences form contiguous blocks of length . The difference-1 sequences are themselves contiguous blocks of length 4, so the number of sequences in this case is the number of ordered partitions of 64 into 4's and 16's. This is the same as the number of ordered partitions of 16 into 1's and 4's, which we calculated in Case 1; there are 95 of them.
Summing over all cases, we get . However, we overcount any partition with only one type of sequence, of which there are three (one for each type). Thus, the answer is .