p1. Find all real numbers that satisfy the equation $$(1 + x^2 + x^4 + .... + x^{2014})(x^{2016} + 1) = 2016x^{2015}$$


p2. Let $A$ be an integer and $A = 2 + 20 + 201 + 2016 + 20162 + ... + \underbrace{20162016...2016}_{40\,\, digits}$
Find the last seven digits of $A$, in order from millions to units.


p3. In triangle $ABC$, points $P$ and $Q$ are on sides of $BC$ so that the length of $BP$ is equal to $CQ$, $\angle BAP = \angle CAQ$ and $\angle APB$ is acute. Is triangle $ABC$ isosceles? Write down your reasons.


p4. Ayu is about to open the suitcase but she forgets the key. The suitcase code consists of nine digits, namely four $0$s (zero) and five $1$s. Ayu remembers that no four consecutive numbers are the same. How many codes might have to try to make sure the suitcase is open?


p5. Fulan keeps $100$ turkeys with the weight of the $i$-th turkey, being $x_i$ for $i\in\{1, 2, 3, ... , 100\}$. The weight of the $i$-th turkey in grams is assumed to follow the function $x_i(t) = S_it + 200 - i$ where $t$ represents the time in days and $S_i$ is the $i$-th term of an arithmetic sequence where the first term is a positive number $a$ with a difference of $b =\frac15$. It is known that the average data on the weight of the hundred turkeys at $t = a$ is $150.5$ grams. Calculate the median weight of the turkey at time $t = 20$ days.
1. **Problem 1:**
   We start with the given equation:
   \[
   (1 + x^2 + x^4 + \cdots + x^{2014})(x^{2016} + 1) = 2016x^{2015}
   \]
   The series \(1 + x^2 + x^4 + \cdots + x^{2014}\) is a geometric series with the first term \(a = 1\) and common ratio \(r = x^2\). The sum of this series can be written as:
   \[
   S = \frac{1 - x^{2016}}{1 - x^2}
   \]
   Substituting this into the original equation, we get:
   \[
   \left(\frac{1 - x^{2016}}{1 - x^2}\right)(x^{2016} + 1) = 2016x^{2015}
   \]
   Simplifying the left-hand side:
   \[
   \frac{(1 - x^{2016})(x^{2016} + 1)}{1 - x^2} = \frac{x^{2016} + 1 - x^{4032} - x^{2016}}{1 - x^2} = \frac{1 - x^{4032}}{1 - x^2}
   \]
   Thus, the equation becomes:
   \[
   \frac{1 - x^{4032}}{1 - x^2} = 2016x^{2015}
   \]
   For the equation to hold, the numerator \(1 - x^{4032}\) must be zero, which implies:
   \[
   x^{4032} = 1
   \]
   The solutions to this equation are the 4032nd roots of unity. However, we need to check which of these roots satisfy the original equation. Substituting \(x = 1\) into the original equation:
   \[
   (1 + 1^2 + 1^4 + \cdots + 1^{2014})(1^{2016} + 1) = 2016 \cdot 1^{2015}
   \]
   Simplifies to:
   \[
   1008 \cdot 2 = 2016
   \]
   Which is true. Therefore, \(x = 1\) is a solution. For other roots of unity, we need to check if they satisfy the equation. However, since the equation involves a geometric series and the roots of unity, the only real solution is \(x = 1\).

   \(\blacksquare\)

2. **Problem 2:**
   We need to find the last seven digits of the sum \(A = 2 + 20 + 201 + 2016 + 20162 + \cdots + \underbrace{20162016\ldots2016}_{40\,\, digits}\). Notice that each term in the sequence can be written as \(2 \times 10^k\) where \(k\) is the number of digits minus one. The last seven digits of each term are the last seven digits of \(2 \times 10^k\). Since \(10^k\) for \(k \geq 7\) will have at least seven zeros, the last seven digits of each term will be zero except for the first few terms. Therefore, we only need to consider the first few terms:
   \[
   2, 20, 201, 2016, 20162
   \]
   Summing these:
   \[
   2 + 20 + 201 + 2016 + 20162 = 22301
   \]
   The last seven digits of \(22301\) are \(00022301\).

   \(\boxed{22301}\)

3. **Problem 3:**
   Given that \(BP = CQ\), \(\angle BAP = \angle CAQ\), and \(\angle APB\) is acute, we need to determine if \(\triangle ABC\) is isosceles. Since \(\angle BAP = \angle CAQ\), triangles \(BAP\) and \(CAQ\) are similar by AA similarity. Since \(BP = CQ\), the triangles are also congruent by SAS congruence. Therefore, \(AB = AC\), making \(\triangle ABC\) isosceles.

   \(\blacksquare\)

4. **Problem 4:**
   Using complementary counting, the total number of combinations of four 0s and five 1s is:
   \[
   \frac{9!}{4!5!} = 126
   \]
   We need to subtract the number of invalid combinations where four consecutive digits are the same. For four consecutive 0s, there are 6 combinations. For four consecutive 1s, there are 15 combinations. For both, there are 4 combinations. Therefore, the total number of invalid combinations is:
   \[
   6 + 15 - 4 = 17
   \]
   Thus, the number of valid codes is:
   \[
   126 - 17 = 109
   \]

   \(\boxed{109}\)

5. **Problem 5:**
   The weight of the \(i\)-th turkey is given by \(x_i(t) = S_i t + 200 - i\), where \(S_i\) is the \(i\)-th term of an arithmetic sequence with the first term \(a\) and common difference \(b = \frac{1}{5}\). The average weight at \(t = a\) is 150.5 grams. Therefore:
   \[
   \frac{1}{100} \sum_{i=1}^{100} (S_i a + 200 - i) = 150.5
   \]
   Simplifying:
   \[
   \sum_{i=1}^{100} S_i a + \sum_{i=1}^{100} (200 - i) = 15050
   \]
   The sum of the first 100 terms of the arithmetic sequence \(S_i\) is:
   \[
   S_i = a + (i-1) \frac{1}{5}
   \]
   Therefore:
   \[
   \sum_{i=1}^{100} S_i = 100a + \frac{1}{5} \sum_{i=1}^{99} i = 100a + \frac{1}{5} \cdot \frac{99 \cdot 100}{2} = 100a + 990
   \]
   Substituting back:
   \[
   a(100a + 990) + 20000 - 5050 = 15050
   \]
   Solving for \(a\):
   \[
   100a^2 + 990a + 14950 = 15050
   \]
   \[
   100a^2 + 990a - 100 = 0
   \]
   Solving this quadratic equation, we get:
   \[
   a = 0.1
   \]
   The median weight at \(t = 20\) days is the 50th and 51st terms of the sorted weights. The weight of the 50th turkey is:
   \[
   x_{50}(20) = S_{50} \cdot 20 + 200 - 50 = (0.1 + 49 \cdot 0.2) \cdot 20 + 150 = 200
   \]
   The weight of the 51st turkey is:
   \[
   x_{51}(20) = S_{51} \cdot 20 + 200 - 51 = (0.1 + 50 \cdot 0.2) \cdot 20 + 149 = 201
   \]
   Therefore, the median weight is:
   \[
   \frac{200 + 201}{2} = 200.5
   \]

   \(\boxed{200.5}\)