Let be a positive integer. Find the number of sequences , where for each , satisfying the following condition: for any integer and such that then the following inequality holds
Problem 1424
Official solution
1. Define the problem and constraints: We need to find the number of sequences where for each , such that for any integers and with , the inequality holds.
2. Group the terms: Consider the sequence in pairs for . Define . The possible values for are:
- if and
- if and
- if and or and
3. Analyze the constraints: The condition implies that the sum of any contiguous subsequence of pairs must be between -2 and 2. This means that the sequence of values must be such that the sum of any contiguous subsequence of values is between -2 and 2.
4. Count the valid sequences:
- If , there are 2 ways to choose .
- If or , there is only 1 way to choose .
5. Formulate the sequence: The sequence of values must be such that the sum of any contiguous subsequence is between -2 and 2. This means that the sequence can have any number of 0s, but the non-zero values must alternate between 2 and -2.
6. Calculate the number of sequences:
- Let be the number of pairs where . There are ways to choose these positions.
- For each of these positions, there are ways to assign .
- For the remaining positions, the non-zero values must alternate between 2 and -2. There are 2 ways to start this alternation (starting with 2 or starting with -2).
7. **Sum over all possible values of **:
8. Simplify the expression: Using the binomial theorem, we have:
Therefore, the total number of sequences is:
9. Subtract the overcounted sequences: We need to subtract the sequences where all , which is sequences.
10. Final count: