Given a positive integer , if the sequence satisfies the following two properties at the same time, then the sequence is called the sequence:
- For any , there is always such that . Let the number of sequences be
(1) Write two sequence
(2) If is the sequence, find the value of ;
(3) Find the maximum value of .
(1)Easy to write: (2) From (1), we know that not all numbers can be used as , and the middle number (2) will cause problems (|x-2|=2, x is out of range).
Enumeration is simple:
n=3,
Make a few simple observations:
- , will not affect conditions 1 and 2
- If is feasible , then is also feasible
Digging deeper into (1), we guess that if , a contradiction may be derived.
When :
Note , where
, where
According to 2, can continuously generate items in , then the last two items of must be numbers in , with the same parity as .
Let's assume that is an odd number, use the extreme principle, and consider that the last item in is an even number. When pushing backward, a contradiction will appear.
If is an even number, consider the last odd term in the same way and derive a contradiction.
To sum up,
(2) Notice that and have the same parity, so the odd and even columns in “do their own thing”.
Remember ,
According to (2), must be one odd and one even.
Consider the order in which the odd sequence (a total of ) appears in . In the same way as (2), the first appearance in must be 1 or x
Next, the minimum or maximum value among the remaining numbers appears in sequence, in a total of order.
In the same way, the even sequence (a total of numbers) appears in the sequence in a total of .
We then consider the absolute position of the odd column in :
In the last two items of , there is exactly one odd number, and the remaining odd numbers are in the first slots.
Select the absolute position of the odd-numbered column, and the absolute position of the even-numbered column is determined.
And because the internal relative positions of the odd and even columns have just been determined, according to the principle of step-by-step multiplication: Classify n according to parity: Among them
It’s not difficult to calculate Therefore, the maximum value of is 4, which is obtained if and only if .
Another write-up of part (2) (added by Claude)
This section was added by Claude, an AI model made by Anthropic, after the author's solution. It is not written by the original author.
The condition only links numbers of the same parity, so treat the odd class and the even class separately.
Step 1: the last two terms are one odd and one even. The last-positioned number of each class has no later number of its class, so it cannot sit in the first positions; it must be at position or . There is one such number per class, so the last two terms are one odd and one even, and every other number needs a later same-class number differing by 2.
Step 2: read backwards, each class grows outward from a run. Read one class in reverse order of position, starting with its last number. Each newly read number sits at position at most , so or appears after it, i.e. has already been read. By induction the numbers read so far always form a run of consecutive members of the class (adjacent ones differ by 2), and each new number attaches at one end of the run.
Hence the first number of each class to appear is the class minimum or maximum. Since is the first number of its class,
- for , , and all four occur, e.g. , and their images under ;
- for the even class is just , which is its own last number and must be in the last two positions, so .
Step 2 also gives the count in (3): a class of numbers grows left or right at each step until only one choice is left, which gives orders, matching the author's count (I checked the author's formula by exhaustive search for ).
Loading comments…