Navvye/Olympiad-Problems-CSV huggingface dataset:
Problem: In the following list of numbers, the integer $n$ appears $n$ times in the list for $1 \leq n \leq 200$ \[1, 2, 2, 3, 3, 3, 4, 4, 4, 4, \ldots, 200, 200, \ldots , 200\] What is the median of the numbers in this list?
$\textbf{(A)} ~100.5 \qquad\textbf{(B)} ~134 \qquad\textbf{(C)} ~142 \qquad\textbf{(D)} ~150.5 \qquad\textbf{(E)} ~167$

Solution: We can look at answer choice $\textbf{(C)}$ , which is $142$ first. That means that the number of numbers from $1$ to $142$ is roughly the number of numbers from $143$ to $200$
The number of numbers from $1$ to $142$ is $\frac{142(142+1)}{2}$ which is approximately $10000.$ The number of numbers from $143$ to $200$ is $\frac{200(200+1)}{2}-\frac{142(142+1)}{2}$ which is approximately $10000$ as well. Therefore, we can be relatively sure the answer choice is $\boxed{142}.$

Answer: C 142
Problem: In the following list of numbers, the integer $n$ appears $n$ times in the list for $1 \leq n \leq 200$ \[1, 2, 2, 3, 3, 3, 4, 4, 4, 4, \ldots, 200, 200, \ldots , 200\] What is the median of the numbers in this list?
$\textbf{(A)} ~100.5 \qquad\textbf{(B)} ~134 \qquad\textbf{(C)} ~142 \qquad\textbf{(D)} ~150.5 \qquad\textbf{(E)} ~167$

Solution: We can arrange the numbers in the following pattern: \[ \begin{array}{cccccc} \ &\ &\ &\ &\ 200 & \\ \ &\ &\ &\ 199 & \ 200 & \\ \ &\ &\ \iddots& \ \vdots& \ \vdots& \\ \ &\ 2& \ \cdots& \ 199& \ 200& \\ 1 & \ 2 & \ \cdots& \ 199& \ 200& \end{array} \]
We can see this as a isosceles right triangle, with legs of length $200.$ [asy]draw((0,0)--(200,200)--(200,0)--cycle); draw((142,0)--(142,142)); label("$x$",(142,0)--(142,142),E); label("$x$",(0,0)--(142,0),S); label("$200$",(200,0)--(200,200),E); [/asy]
Let $x$ be the side length such that both sides of the triangle have the same area. The desired answer is then around $x$ because about half of the numbers in the list fall on each side.
Solving for $x$ yields: \begin{align*} \frac{x^2}{2} =& \:\frac{1}{2} \cdot \frac{200^2}{2} \\ x^2 =& \:\frac{1}{2}\cdot 200^2 \\ x =& \:\frac{200}{\sqrt{2}} = \: 100\sqrt{2} \approx 141. \end{align*} We see that $\boxed{142}$ is the closest to $x$ by far, and thus, can be relatively certain this is the answer.

Answer: C 142
Problem: Trapezoid $ABCD$ has $\overline{AB}\parallel\overline{CD},BC=CD=43$ , and $\overline{AD}\perp\overline{BD}$ . Let $O$ be the intersection of the diagonals $\overline{AC}$ and $\overline{BD}$ , and let $P$ be the midpoint of $\overline{BD}$ . Given that $OP=11$ , the length of $AD$ can be written in the form $m\sqrt{n}$ , where $m$ and $n$ are positive integers and $n$ is not divisible by the square of any prime. What is $m+n$
$\textbf{(A) }65 \qquad \textbf{(B) }132 \qquad \textbf{(C) }157 \qquad \textbf{(D) }194\qquad \textbf{(E) }215$

Solution: Angle chasing* reveals that $\triangle BPC\sim\triangle BDA$ , therefore \[2=\frac{BD}{BP}=\frac{AB}{BC}=\frac{AB}{43},\] or $AB=86$
Additional angle chasing shows that $\triangle ABO\sim\triangle CDO$ , therefore \[2=\frac{AB}{CD}=\frac{BO}{OD}=\frac{BP+11}{BP-11},\] or $BP=33$ and $BD=66$
Since $\triangle ADB$ is right, the Pythagorean theorem implies that \[AD=\sqrt{86^2-66^2}=4\sqrt{190}.\] The answer is $4+190=\boxed{194}$

Answer: D 194
Problem: Trapezoid $ABCD$ has $\overline{AB}\parallel\overline{CD},BC=CD=43$ , and $\overline{AD}\perp\overline{BD}$ . Let $O$ be the intersection of the diagonals $\overline{AC}$ and $\overline{BD}$ , and let $P$ be the midpoint of $\overline{BD}$ . Given that $OP=11$ , the length of $AD$ can be written in the form $m\sqrt{n}$ , where $m$ and $n$ are positive integers and $n$ is not divisible by the square of any prime. What is $m+n$
$\textbf{(A) }65 \qquad \textbf{(B) }132 \qquad \textbf{(C) }157 \qquad \textbf{(D) }194\qquad \textbf{(E) }215$

Solution: Since $\triangle BCD$ is isosceles with base $\overline{BD},$ it follows that median $\overline{CP}$ is also an altitude. Let $OD=x$ and $CP=h,$ so $PB=x+11.$
Since $\angle AOD=\angle COP$ by vertical angles, we conclude that $\triangle AOD\sim\triangle COP$ by AA, from which $\frac{AD}{CP}=\frac{OD}{OP},$ or \[AD=CP\cdot\frac{OD}{OP}=h\cdot\frac{x}{11}.\] Let the brackets denote areas. Notice that $[AOD]=[BOC]$ (By the same base and height, we deduce that $[ACD]=[BDC].$ Subtracting $[OCD]$ from both sides gives $[AOD]=[BOC].$ ). Doubling both sides produces \begin{align*} 2[AOD]&=2[BOC] \\ OD\cdot AD&=OB\cdot CP \\ x\left(\frac{hx}{11}\right)&=(x+22)h \\ x^2&=11(x+22). \end{align*} Rearranging and factoring result in $(x-22)(x+11)=0,$ from which $x=22.$
Applying the Pythagorean Theorem to right $\triangle CPB,$ we have \[h=\sqrt{43^2-33^2}=\sqrt{(43+33)(43-33)}=\sqrt{760}=2\sqrt{190}.\] Finally, we get \[AD=h\cdot\frac{x}{11}=4\sqrt{190},\] so the answer is $4+190=\boxed{194}.$

Answer: D 194
Problem: Trapezoid $ABCD$ has $\overline{AB}\parallel\overline{CD},BC=CD=43$ , and $\overline{AD}\perp\overline{BD}$ . Let $O$ be the intersection of the diagonals $\overline{AC}$ and $\overline{BD}$ , and let $P$ be the midpoint of $\overline{BD}$ . Given that $OP=11$ , the length of $AD$ can be written in the form $m\sqrt{n}$ , where $m$ and $n$ are positive integers and $n$ is not divisible by the square of any prime. What is $m+n$
$\textbf{(A) }65 \qquad \textbf{(B) }132 \qquad \textbf{(C) }157 \qquad \textbf{(D) }194\qquad \textbf{(E) }215$

Solution: Let $CP = y$ $CP$ a is perpendicular bisector of $DB.$ Then, let $DO = x,$ thus $DP = PB = 11+x.$
(1) $\triangle CPO \sim \triangle ADO,$ so we get $\frac{AD}{x} = \frac{y}{11},$ or $AD = \frac{xy}{11}.$
(2) Applying Pythagorean Theorem on $\triangle CDP$ gives $(11+x)^2 + y^2 = 43^2.$
(3) $\triangle BPC \sim \triangle BDA$ with ratio $1:2,$ so $AD = 2y$ using the fact that $P$ is the midpoint of $BD$
Thus, $\frac{xy}{11} = 2y,$ or $x = 22.$ And $y = \sqrt{43^2 - 33^2} = 2 \sqrt{190},$ so $AD = 4 \sqrt{190}$ and the answer is $4+190=\boxed{194}.$

Answer: D 194
Problem: Trapezoid $ABCD$ has $\overline{AB}\parallel\overline{CD},BC=CD=43$ , and $\overline{AD}\perp\overline{BD}$ . Let $O$ be the intersection of the diagonals $\overline{AC}$ and $\overline{BD}$ , and let $P$ be the midpoint of $\overline{BD}$ . Given that $OP=11$ , the length of $AD$ can be written in the form $m\sqrt{n}$ , where $m$ and $n$ are positive integers and $n$ is not divisible by the square of any prime. What is $m+n$
$\textbf{(A) }65 \qquad \textbf{(B) }132 \qquad \textbf{(C) }157 \qquad \textbf{(D) }194\qquad \textbf{(E) }215$

Solution: Observe that $\triangle BPC$ is congruent to $\triangle DPC$ ; both are similar to $\triangle BDA$ . Let's extend $\overline{AD}$ and $\overline{BC}$ past points $D$ and $C$ respectively, such that they intersect at a point $E$ . Observe that $\angle BDE$ is $90$ degrees, and that $\angle DBE \cong \angle PBC \cong \angle DBA \implies \angle DBE \cong \angle DBA$ . Thus, by ASA, we know that $\triangle ABD \cong \triangle EBD$ , thus, $AD = ED$ , meaning $D$ is the midpoint of $AE$ .
Let $M$ be the midpoint of $\overline{DE}$ . Note that $\triangle CME$ is congruent to $\triangle BPC$ , thus $BC = CE$ , meaning $C$ is the midpoint of $\overline{BE}.$
Therefore, $\overline{AC}$ and $\overline{BD}$ are both medians of $\triangle ABE$ . This means that $O$ is the centroid of $\triangle ABE$ ; therefore, because the centroid divides the median in a 2:1 ratio, $\frac{BO}{2} = DO = \frac{BD}{3}$ . Recall that $P$ is the midpoint of $BD$ $DP = \frac{BD}{2}$ . The question tells us that $OP = 11$ $DP-DO=11$ ; we can write this in terms of $DB$ $\frac{DB}{2}-\frac{DB}{3} = \frac{DB}{6} = 11 \implies DB = 66$
We are almost finished. Each side length of $\triangle ABD$ is twice as long as the corresponding side length $\triangle CBP$ or $\triangle CPD$ , since those triangles are similar; this means that $AB = 2 \cdot 43 = 86$ . Now, by Pythagorean theorem on $\triangle ABD$ $AB^{2} - BD^{2} = AD^{2} \implies 86^{2}-66^{2} = AD^{2} \implies AD = \sqrt{3040} \implies AD = 4 \sqrt{190}$
The answer is $4+190 = \boxed{194}$

Answer: D 194
Problem: Trapezoid $ABCD$ has $\overline{AB}\parallel\overline{CD},BC=CD=43$ , and $\overline{AD}\perp\overline{BD}$ . Let $O$ be the intersection of the diagonals $\overline{AC}$ and $\overline{BD}$ , and let $P$ be the midpoint of $\overline{BD}$ . Given that $OP=11$ , the length of $AD$ can be written in the form $m\sqrt{n}$ , where $m$ and $n$ are positive integers and $n$ is not divisible by the square of any prime. What is $m+n$
$\textbf{(A) }65 \qquad \textbf{(B) }132 \qquad \textbf{(C) }157 \qquad \textbf{(D) }194\qquad \textbf{(E) }215$

Solution: Since $P$ is the midpoint of isosceles triangle $BCD$ , it would be pretty easy to see that $CP\perp BD$ . Since $AD\perp BD$ as well, $AD\parallel CP$ . Connecting $AP$ , it’s obvious that $[ADC]=[ADP]$ . Since $DP=BP$ $[APB]=[ADC]$
Since $P$ is the midpoint of $BD$ , the height of $\triangle APB$ on side $AB$ is half that of $\triangle ADC$ on $CD$ . Since $[APB]=[ADC]$ $AB=2CD$
As a basic property of a trapezoid, $\triangle AOB \sim \triangle COD$ , so $\frac{OB}{OD}=\frac{AB}{CD}=2$ , or $OB=2OD$ . Letting $OD=x$ , then $PB=DP=11+x$ , and $OB=22+x$ . Hence $22+x=2x$ and $x=22$
Since $\triangle AOD \sim \triangle COP$ $\frac{AD}{PC}=\frac{OD}{OP}=2$ . Since $PD=11+22=33$ $PC=\sqrt{43^2-33^2}=\sqrt{760}$
So, $AD=2\sqrt{760}=4\sqrt{190}$ . The correct answer is $\boxed{194}$

Answer: D 194
Problem: Trapezoid $ABCD$ has $\overline{AB}\parallel\overline{CD},BC=CD=43$ , and $\overline{AD}\perp\overline{BD}$ . Let $O$ be the intersection of the diagonals $\overline{AC}$ and $\overline{BD}$ , and let $P$ be the midpoint of $\overline{BD}$ . Given that $OP=11$ , the length of $AD$ can be written in the form $m\sqrt{n}$ , where $m$ and $n$ are positive integers and $n$ is not divisible by the square of any prime. What is $m+n$
$\textbf{(A) }65 \qquad \textbf{(B) }132 \qquad \textbf{(C) }157 \qquad \textbf{(D) }194\qquad \textbf{(E) }215$

Solution: Let $D$ be the origin of the cartesian coordinate plane, $B$ lie on the positive $x$ -axis, and $A$ lie on the negative $y$ -axis. Then let the coordinates of $B = (2a,0), A = (0, -2b).$ Then the slope of $AB$ is $\frac{b}{a}.$ Since $AB \parallel CD$ the slope of $CD$ is the same. Note that as $\triangle DCB$ is isosceles $C$ lies on $x = a.$ Thus since $CD$ has equation $y = \frac{b}{a}x$ $D$ is the origin), $C = (a,b).$ Therefore $AC$ has equation $y = \frac{3b}{a}x - 2b$ and intersects $BD$ $x$ -axis) at $O =\left(\frac{2}{3}a, 0\right).$ The midpoint of $BD$ is $P = (a,0),$ so $OP = \frac{a}{3} = 11,$ from which $a = 33.$ Then by Pythagorean theorem on $\triangle DPC$ $\triangle DBC$ is isosceles), we have $b = \sqrt{43^2 - 33^2} = 2\sqrt{190},$ so $2b=4\sqrt{190}.$
Finally, the answer is $4+190=\boxed{194}.$

Answer: D 194
Problem: The area of the region bounded by the graph of \[x^2+y^2 = 3|x-y| + 3|x+y|\] is $m+n\pi$ , where $m$ and $n$ are integers. What is $m + n$
$\textbf{(A)} ~18\qquad\textbf{(B)} ~27\qquad\textbf{(C)} ~36\qquad\textbf{(D)} ~45\qquad\textbf{(E)} ~54$

Solution: In order to attack this problem, we can use casework on the sign of $|x-y|$ and $|x+y|$
Case 1: $|x-y|=x-y, |x+y|=x+y$
Substituting and simplifying, we have $x^2-6x+y^2=0$ , i.e. $(x-3)^2+y^2=3^2$ , which gives us a circle of radius $3$ centered at $(3,0)$
Case 2: $|x-y|=y-x, |x+y|=x+y$
Substituting and simplifying again, we have $x^2+y^2-6y=0$ , i.e. $x^2+(y-3)^2=3^2$ . This gives us a circle of radius $3$ centered at $(0,3)$
Case 3: $|x-y|=x-y, |x+y|=-x-y$
Doing the same process as before, we have $x^2+y^2+6y=0$ , i.e. $x^2+(y+3)^2=3^2$ . This gives us a circle of radius $3$ centered at $(0,-3)$
Case 4: $|x-y|=y-x, |x+y|=-x-y$
One last time: we have $x^2+y^2+6x=0$ , i.e. $(x+3)^2+y^2=3^2$ . This gives us a circle of radius $3$ centered at $(-3,0)$
After combining all the cases and drawing them on the Cartesian Plane, this is what the diagram looks like:
[asy] size(10cm);  Label f;  f.p=fontsize(7); xaxis(-8,8,Ticks(f, 1.0));  yaxis(-8,8,Ticks(f, 1.0));  draw(arc((-3,0),3,90,270) -- cycle, gray); draw(arc((0,3),3,0,180) -- cycle, gray); draw(arc((3,0),3,-90,90) -- cycle, gray); draw(arc((0,-3),3,-180,0) -- cycle, gray); draw((-3,3)--(3,3)--(3,-3)--(-3,-3)--cycle, grey); [/asy] Now, the area of the shaded region is just a square with side length $6$ with four semicircles of radius $3$ .
The area is $6\cdot6+4\cdot \frac{9\pi}{2} = 36+18\pi$ . The answer is $36+18$ which is $\boxed{54}$

Answer: E 54
Problem: The area of the region bounded by the graph of \[x^2+y^2 = 3|x-y| + 3|x+y|\] is $m+n\pi$ , where $m$ and $n$ are integers. What is $m + n$
$\textbf{(A)} ~18\qquad\textbf{(B)} ~27\qquad\textbf{(C)} ~36\qquad\textbf{(D)} ~45\qquad\textbf{(E)} ~54$

Solution: A somewhat faster variant of solution 1 is to use a bit of symmetry in order to show that the remaining three cases are identical to Case 1 in the above solution, up to rotations by $90^{\circ}$ about the origin. This allows us to quickly sketch the region after solving Case 1.
Upon simplifying Case 1, we obtain $(x-3)^2 + y^2 = 3^2$ which is a circle of radius 3 centered at $(3,0)$ . We remark that only the points on the semicircle where $x \ge 3$ work here, since Case 1 assumes $x-y \ge 0$ and $x+y \ge 0$ . Next, we observe that an ordered pair is a solution to the given equation if and only if any of its $90^{\circ}$ rotations about the origin is a solution. This follows as the value of $x^2+y^2-3(|x-y|+|x+y|)$ is invariant to $90^{\circ}$ rotations, since $x^2+y^2$ simply represents the square of the distance to the origin (which is unchanged upon rotation), and $|x-y|+|x+y|$ is the sum of the distances to the lines $y=x$ and $y=-x$ , multiplied by $\sqrt{2}$ (also unchanged upon $90^{\circ}$ rotation).
By the above observation, we can quickly sketch the remainder of the region, and the area is $\boxed{54}$ as above.

Answer: E 54
Problem: The area of the region bounded by the graph of \[x^2+y^2 = 3|x-y| + 3|x+y|\] is $m+n\pi$ , where $m$ and $n$ are integers. What is $m + n$
$\textbf{(A)} ~18\qquad\textbf{(B)} ~27\qquad\textbf{(C)} ~36\qquad\textbf{(D)} ~45\qquad\textbf{(E)} ~54$

Solution: Assume $y$ $0$ . We get that $x$ $6$ . That means that this figure must contain the points $(0,6), (6,0), (0, -6), (-6, 0)$ . Now, assume that $x$ $y$ . We get that $x$ $3 \sqrt 3$ . We get the points $(3,3), (3,-3), (-3, 3), (-3, -3)$
Since this contains $x^2 + y^2$ , assume that there are circles. Therefore, we can guess that there is a center square with area $6 \cdot 6$ $36$ and $4$ semicircles with radius $3$ . We get $4$ semicircles with area $4.5 \pi$ , and therefore the answer is $36+18$ $\boxed{54}$

Answer: E 54
Problem: In how many ways can the sequence $1,2,3,4,5$ be rearranged so that no three consecutive terms are increasing and no three consecutive terms are decreasing?
$\textbf{(A)} ~10\qquad\textbf{(B)} ~18\qquad\textbf{(C)} ~24 \qquad\textbf{(D)} ~32 \qquad\textbf{(E)} ~44$

Solution: We write out the $5!=120$ cases, then filter out the valid ones:
$13254,14253,14352,15243,15342,21435,21534,23154,24153,24351,25143,25341,\linebreak  31425,31524,32415,32514,34152,34251,35142,35241,41325,41523,42315,42513,\linebreak 43512,45132,45231,51324,51423,52314,52413,53412.$
We count these out and get $\boxed{32}$ permutations that work.

Answer: D 32
Problem: In how many ways can the sequence $1,2,3,4,5$ be rearranged so that no three consecutive terms are increasing and no three consecutive terms are decreasing?
$\textbf{(A)} ~10\qquad\textbf{(B)} ~18\qquad\textbf{(C)} ~24 \qquad\textbf{(D)} ~32 \qquad\textbf{(E)} ~44$

Solution: Reading the terms from left to right, we have two cases for the consecutive digits, where $+$ means increase and $-$ means decrease:
$\textbf{Case \#1: }\boldsymbol{+,-,+,-}$
$\textbf{Case \#2: }\boldsymbol{-,+,-,+}$
For $\text{Case \#1},$ note that for the second and fourth terms, one term must be $5,$ and the other term must be either $3$ or $4.$ We have four subcases:
$(1) \ \underline{\hspace{3mm}}3\underline{\hspace{3mm}}5\underline{\hspace{3mm}}$
$(2) \ \underline{\hspace{3mm}}5\underline{\hspace{3mm}}3\underline{\hspace{3mm}}$
$(3) \ \underline{\hspace{3mm}}4\underline{\hspace{3mm}}5\underline{\hspace{3mm}}$
$(4) \ \underline{\hspace{3mm}}5\underline{\hspace{3mm}}4\underline{\hspace{3mm}}$
For $(1),$ the first two blanks must be $1$ and $2$ in some order, and the last blank must be $4.$ So, we get $2$ possibilities. Similarly, $(2)$ also has $2$ possibilities.
For $(3),$ there are no restrictions for the numbers $1, 2,$ and $3.$ So, we get $3!=6$ possibilities. Similarly, $(4)$ also has $6$ possibilities.
Together, $\text{Case \#1}$ has $2+2+6+6=16$ possibilities. By symmetry, $\text{Case \#2}$ also has $16$ possibilities.
Finally, the answer is $16+16=\boxed{32}.$

Answer: D 32
Problem: In how many ways can the sequence $1,2,3,4,5$ be rearranged so that no three consecutive terms are increasing and no three consecutive terms are decreasing?
$\textbf{(A)} ~10\qquad\textbf{(B)} ~18\qquad\textbf{(C)} ~24 \qquad\textbf{(D)} ~32 \qquad\textbf{(E)} ~44$

Solution: Like Solution 3, we have two cases. Due to symmetry, we just need to count one of the cases. For the purpose of this solution, we will be doing $-,+,-,+$ . Instead of starting with 5, we start with 1.
There are two ways to place it:
_1_ _ _
_ _ _1_
Now we place 2, it can either be next to 1 and on the outside, or is place in where 1 would go in the other case. So now we have another two "sub case":
_1_2_(case 1)
21_ _ _(case 2)
There are 3! ways to arrange the rest for case 1, since there is no restriction.
For case 2, we need to consider how many ways to arrange 3,4,5 in a a>b<c fashion. It should seem pretty obvious that b has to be 3, so there will be 2! way to put 4 and 5.
Now we find our result, times 2 for symmetry, times 2 for placement of 1 and times (3!+2!) for the two different cases for placement of 2. This give us $2*2*(3!+2!)=4*(6+2)=\boxed{32}$

Answer: D 32
Problem: In how many ways can the sequence $1,2,3,4,5$ be rearranged so that no three consecutive terms are increasing and no three consecutive terms are decreasing?
$\textbf{(A)} ~10\qquad\textbf{(B)} ~18\qquad\textbf{(C)} ~24 \qquad\textbf{(D)} ~32 \qquad\textbf{(E)} ~44$

Solution: We only need to find the # of rearrangements when 5 is the 4th digit and 5th digit. Find the total, and multiply by 2. Then we can get the answer by adding the case when 5 is the third digit.
Case $1$ 5 is the 5th digit. __ __ __ __ 5
Then $4$ can only be either 1st digit or the 3rd digit.
4 __ __ __ 5, then the only way is that $3$ is the 3rd digit, so it can be either $231$ or $132$ , give us $2$ results.
__ __ 4 __ 5, then the 1st digit must be $2$ or $3$ $2$ gives us $1$ way, and $3$ gives us $2$ ways. (Can't be $1$ because the first digit would increasing). Therefore, $4$ in the middle and $5$ in the last would result in $3$ ways.
Case $2$ $5$ is the fourth digit. __ __ __ 5 __
Then the last digit can be all of the 4 numbers $1$ $2$ $3$ , and $4$ . Let's say if the last digit is $4$ , then the 2nd digit would be the largest for the remaining digits to prevent increasing order or decreasing order. Then the remaining two are interchangeable, give us $2!$ ways. All of the $4$ can work, so case $2$ would result in $2!+2!+2!+2!=8$ ways.
Case $3$ $5$ is in the middle. __ __ 5 __ __
Then there are only two cases: 
1. $42513$ , then 4 and 3 are interchangeable, which results in $2!*2!$ . Or it can be $43512$ , then 4 and 2 are interchangeable, but it can not be $23514$ , so there can only be 2 possible ways: $43512$ $21534$
Therefore, case 3 would result in $4+2=6$ ways.
$8+3+2=13$ , so the total ways for case 1 and case 2 with both increasing and decreasing would be $13*2=26.$
Finally, we have $26+6=\boxed{32}.$

Answer: D 32
Problem: In how many ways can the sequence $1,2,3,4,5$ be rearranged so that no three consecutive terms are increasing and no three consecutive terms are decreasing?
$\textbf{(A)} ~10\qquad\textbf{(B)} ~18\qquad\textbf{(C)} ~24 \qquad\textbf{(D)} ~32 \qquad\textbf{(E)} ~44$

Solution: First, we list the triples that are invalid:
543, 542, 541, 532, 531, 521, 432, 431, 321
By symmetry, there are the same amount of increasing triplets as there are decreasing ones. This yields 18 invalid 3 digit permutations in total.
Suppose the triplet is ABC and the other 2 digits are X and Y. We then have 3 ways to arrange a triplet with 2 other digits.
ABCXY, XABCY, XYABC
X and Y can be arranged 2 ways.
XY, YX
This produces 18*3*2=108 permutations of invalid results. We have 5!
ways to arrange 5 numbers so 120-108=12.
Now, we must account for overcounting. For example, when 543 is counted,
it only registers as one invalid permutation but in fact, it is 3 whole
invalid permutations. We then complete this for the rest of the list:
54321 has 543, 432, and 321
54213 has 542 and 421
54123 has 541 and 123
53214 has 532 and 321
53124 has 531 and 124
52134 has 521 and 134
43215 has 432 and 321
43125 has 431 and 125
32145 has 321 and 145
This produces 19 values that we have overcounted but this value itself is also overcounted. We already counted 9 of the terms. This brings the final value of overcounted terms down to 10 for the decreasing triplets. By symmetry, 10 increasing triplets were overcounted.
This gives us $120-108+20=\boxed{32}.$

Answer: D 32
Problem: In how many ways can the sequence $1,2,3,4,5$ be rearranged so that no three consecutive terms are increasing and no three consecutive terms are decreasing?
$\textbf{(A)} ~10\qquad\textbf{(B)} ~18\qquad\textbf{(C)} ~24 \qquad\textbf{(D)} ~32 \qquad\textbf{(E)} ~44$

Solution: It is easier to consider the complement of the desired cases, so try to find the cases that DO have three integers in increasing order. First, write down the sets of three numbers that feature the numbers in increasing order. They are 123, 124, 125, 134, 135, 145, 234, 245, 345. Each of these can be in three positions: the three are in the front with two more numbers in the back, the three are in the middle with two on each side, and two in the front and the set of three in the back. Now, count the number of combinations of 5 numbers that each of the set of three can form that have no been previously accounted for. Also, if the set features both 3 increasing and 3 decreasing, then do not count it because we will separately count them.
\[\begin{tabular}[t]{|l|c|c|c|} \hline Three Increasing Numbers&Front&Middle&Back\\\hline 123&2&2&2\\\hline 124&2&2&2\\\hline 125&1&2&2\\\hline 134&2&2&2\\\hline 135&1&2&2\\\hline 145&1&2&2\\\hline 234&2&1&1\\\hline 245&1&1&1\\\hline 345&1&0&1\\\hline \end{tabular}\]
This gives us a total of 41 possibilities. These account for the possibilities with ONLY increasing numbers. Mirror over to the other side to get the set of combinations with either at least 1 set of 3 increasing numbers in a row or only at least 1 set of 3 decreasing numbers, but not both. We can count the ones with both separately. 14532, 12543, 13542, 54123, 53124, 52134. Total of 6.
$41*2+6=82+6=88$ . This is the compliment. There are a total of $5!=120$ $120-88=32$
Thus, the answer is $\boxed{32}$

Answer: D 32
Problem: In how many ways can the sequence $1,2,3,4,5$ be rearranged so that no three consecutive terms are increasing and no three consecutive terms are decreasing?
$\textbf{(A)} ~10\qquad\textbf{(B)} ~18\qquad\textbf{(C)} ~24 \qquad\textbf{(D)} ~32 \qquad\textbf{(E)} ~44$

Solution: First, note that there is a symmetry from $+,-,+,-$ to $-,+,-,+$ as follows: $a, b, c, d, e \leftrightarrow 6-a, 6-b, 6-c, 6-d, 6-e$ . Now, consider the placement of 5 in the $+,-,+,-$ case. Clearly, 5 is the maximum value, so it must be placed in the 2nd position or the 4th position, but we also have symmetry $a, b, c, d, e \leftrightarrow e, d, c, b, a$ . We will find the number of sequences with 5 in the second position by using casework on the position of the 4.
Case 1:
4 5 __ __ __: 3 is the maximum value, so it must go into the 4th position, leaving us 2 ways to fill in 1 and 2.
Case 2:
__ 5 __ 4 __: 1, 2, and 3 are all less than 4 or 5, so they can be filled in any manner: 3! = 6.
Overall, we have 8 ways to fill in the sequences. By our two types of symmetry, there are $8 \cdot 2 \cdot 2 = \boxed{32}$

Answer: D 32