Assume is a positive integer. Considers sequences for which for all and .
(a) Suppose is odd. Find the number of such sequences if for all .
(b) Suppose is an odd prime. Find the number of such sequences if for all .
Solution
Let be a positive integer. Consider sequences for which for all and .
### Part (a)
Suppose is odd. We need to find the number of such sequences if for all .
Using the principle of inclusion-exclusion, we start by considering the number of ways to choose of the conditions to be disregarded. There are ways to choose conditions. Each condition synchronizes two neighboring entries in the sequence, resulting in groups of entries that move together. There are possibilities for these groups.
For , we must have , which is true for odd . There are possibilities in this case.
Thus, the number of sequences is given by:
Using the binomial theorem, this simplifies to:
### Part (b)
Suppose is an odd prime. We need to find the number of such sequences if for all .
We extend the previous method by choosing places where we disregard the condition, but now we have two possibilities for each place. The condition for counts as one condition, so we need two terms for each to distinguish whether is involved or not.
For , the sum is:
This simplifies to:
For , we need to find the number of ways to choose such that . Since is odd, this reduces to finding subsets of with . This is true if contains all or none of the elements. For other sets, we consider shifts of by adding to each entry of . Since is prime, the sequence of shifted sets has period , and we get each residue mod exactly once.
Thus, there are such sets. Dividing by two (since is the same in both cases), we get:
Therefore, the number of sequences is:
The answer is: