Given a positive integer n(n≥3), if the sequence An:a1,a2,...,an satisfies the following two properties at the same time, then the sequence An is called the P(n) sequence:
- {a1,a2,..,an}={1,2,...,n}
- For any i∈{1,2,...,n−2}, there is always j∈{i+1,i+2,...,n} such that ∣aj−ai∣=2. Let the number of P(n) sequences be bn
(1) Write two P(3) sequence A3
(2) If An is the P(n) sequence, find the value of a1;
(3) Find the maximum value of bnbn+1.
(1)Easy to write: {1,2,3},{1,3,2},{3,1,2},{3,2,1} (2) From (1), we know that not all numbers can be used as a1, and the middle number (2) will cause problems (|x-2|=2, x is out of range).
Enumeration is simple:
n=3, a1=1 or 3
Make a few simple observations:
- a→n+1−a, will not affect conditions 1 and 2
- If 1,2,3,...,n−1,n is feasible An, then n,n−1,n−2,...,1 is also feasible
Digging deeper into (1), we guess that if a1±2∈{1,2,3,...,n}, a contradiction may be derived.
When 3≤n≤n−2:
Note B={a1−2,a1−4,a1−6,...,t}, where t={1,2,a1is an odd numbera1is an even number
C={a1+2,a1+4,a1+6,...,s}, where s={n,n−1,a1Same as n paritya1different from n parity
According to 2, a1 can continuously generate items in B,C, then the last two items of An must be numbers in B,C, with the same parity as a1.
Let's assume that an,an−1 is an odd number, use the extreme principle, and consider that the last item in An is an even number. When pushing backward, a contradiction will appear.
If an,an−1 is an even number, consider the last odd term in the same way and derive a contradiction.
To sum up, a1={1,3,(n=3),1,2,n−1,n,(n≥4)
(2) Notice that ∣aj−ai∣=2 and ai,aj have the same parity, so the odd and even columns in An “do their own thing”.
Remember x={n,nis an odd numbern−1,nis an even number,y={n−1,nis an odd numbern,nis an even number
According to (2), an−1,an must be one odd and one even.
Consider the order in which the odd sequence {1,3,5,...,x} (a total of 2x+1) appears in An. In the same way as (2), the first appearance in An must be 1 or x
Next, the minimum or maximum value among the remaining numbers appears in sequence, in a total of 22x+1−1 order.
In the same way, the even sequence {2,4,6,...,y} (a total of 2y numbers) appears in the sequence in a total of 22y−1.
We then consider the absolute position of the odd column in An:
In the last two items of An, there is exactly one odd number, and the remaining odd numbers are in the first n−2 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: bn=2Cn−22x+1−122x+1−122y−1=Cn−22x−122x+y−1 Classify n according to parity: {b2k−1=C2k−3k−122k−2,b2k=C2k−3k−122k−1 Among them k=2,3,4,...
It’s not difficult to calculate b2k−1b2k=4 b2kb2k+1=4−k2<4 Therefore, the maximum value of bnbn+1 is 4, which is obtained if and only if n=3,5,7,....