Navvye/Olympiad-Problems-CSV huggingface dataset:
Problem: A bowl is formed by attaching four regular hexagons of side $1$ to a square of side $1$ . The edges of the adjacent hexagons coincide, as shown in the figure. What is the area of the octagon obtained by joining the top eight vertices of the four hexagons, situated on the rim of the bowl? [asy] import three; size(225); currentprojection=   orthographic(camera=(-5.52541796301147,-2.61548797564715,1.6545450372312),                up=(0.00247902062334861,0.000877141782387748,0.00966536329192992),                target=(0,0,0),                zoom=0.570588560870951); currentpen = black+1.5bp; triple A = O; triple M = (X+Y)/2; triple B = (-1/2,-1/2,1/sqrt(2)); triple C = (-1,0,sqrt(2)); triple D = (0,-1,sqrt(2)); transform3 rho = rotate(90,M,M+Z);  //arrays of vertices for the lower level (the square), the middle level, //and the interleaves vertices of the upper level (the octagon) triple[] lVs = {A}; triple[] mVs = {B}; triple[] uVsl = {C}; triple[] uVsr = {D};  for(int i = 0; i < 3; ++i){   lVs.push(rho*lVs[i]);   mVs.push(rho*mVs[i]);   uVsl.push(rho*uVsl[i]);   uVsr.push(rho*uVsr[i]); }  lVs.cyclic = true; uVsl.cyclic = true;  for(int i : new int[] {0,1,2,3}){   draw(uVsl[i]--uVsr[i]);   draw(uVsr[i]--uVsl[i+1]); } draw(lVs[0]--lVs[1]^^lVs[0]--lVs[3]); for(int i : new int[] {0,1,3}){   draw(lVs[0]--lVs[i]);   draw(lVs[i]--mVs[i]);   draw(mVs[i]--uVsl[i]); } for(int i : new int[] {0,3}){   draw(mVs[i]--uVsr[i]); }  for(int i : new int[] {1,3}) draw(lVs[2]--lVs[i],dashed); draw(lVs[2]--mVs[2],dashed); draw(mVs[2]--uVsl[2]^^mVs[2]--uVsr[2],dashed); draw(mVs[1]--uVsr[1],dashed);  //Comment two lines below to remove red edges //draw(lVs[1]--lVs[3],red+2bp); //draw(uVsl[0]--uVsr[0],red+2bp); [/asy] $\textbf{(A) }6\qquad\textbf{(B) }7\qquad\textbf{(C) }5+2\sqrt{2}\qquad\textbf{(D) }8\qquad\textbf{(E) }9$

Solution: Denote a square $ABCD, AB = 1,\pi$ is the plane $ABC,$ regular hexagons $ABFKSE, BCHMLF, CDGPNH, ADGQRE,$ triangles $FKL, ESR, GPQ, HMN.$
The main diagonal of each regular hexagon $EF = 2 \implies EFGH$ is square with side $2$ parallel to $\pi.$
The area of this square $[EFGH] = 4 \implies [EFGH] - [ABCD] = 3.$
The difference $3$ is the area of the projection of $4$ half of hexagons on the plane $\pi.$
So the area of the projections of another $4$ half of hexagons is $3.$
It is evident (may be not only for me) that projections of the coincide sides of hexagons  are along diagonals of $ABCD$ (for example $A, E, C,$ and $H$ are collinear.)
So the projections on $\pi$ of the coincide sides of hexagons and triangles are perpendicular to this lines $(SE \perp AE).$
Therefore in plane $\pi$ projections of points $S, E,$ and $R$ are collinear and plane of $\triangle ESR$ is perpendicular to $\pi.$
We get $1 +3 +3 = \boxed{7}.$

Answer: B 7
Problem: A bowl is formed by attaching four regular hexagons of side $1$ to a square of side $1$ . The edges of the adjacent hexagons coincide, as shown in the figure. What is the area of the octagon obtained by joining the top eight vertices of the four hexagons, situated on the rim of the bowl? [asy] import three; size(225); currentprojection=   orthographic(camera=(-5.52541796301147,-2.61548797564715,1.6545450372312),                up=(0.00247902062334861,0.000877141782387748,0.00966536329192992),                target=(0,0,0),                zoom=0.570588560870951); currentpen = black+1.5bp; triple A = O; triple M = (X+Y)/2; triple B = (-1/2,-1/2,1/sqrt(2)); triple C = (-1,0,sqrt(2)); triple D = (0,-1,sqrt(2)); transform3 rho = rotate(90,M,M+Z);  //arrays of vertices for the lower level (the square), the middle level, //and the interleaves vertices of the upper level (the octagon) triple[] lVs = {A}; triple[] mVs = {B}; triple[] uVsl = {C}; triple[] uVsr = {D};  for(int i = 0; i < 3; ++i){   lVs.push(rho*lVs[i]);   mVs.push(rho*mVs[i]);   uVsl.push(rho*uVsl[i]);   uVsr.push(rho*uVsr[i]); }  lVs.cyclic = true; uVsl.cyclic = true;  for(int i : new int[] {0,1,2,3}){   draw(uVsl[i]--uVsr[i]);   draw(uVsr[i]--uVsl[i+1]); } draw(lVs[0]--lVs[1]^^lVs[0]--lVs[3]); for(int i : new int[] {0,1,3}){   draw(lVs[0]--lVs[i]);   draw(lVs[i]--mVs[i]);   draw(mVs[i]--uVsl[i]); } for(int i : new int[] {0,3}){   draw(mVs[i]--uVsr[i]); }  for(int i : new int[] {1,3}) draw(lVs[2]--lVs[i],dashed); draw(lVs[2]--mVs[2],dashed); draw(mVs[2]--uVsl[2]^^mVs[2]--uVsr[2],dashed); draw(mVs[1]--uVsr[1],dashed);  //Comment two lines below to remove red edges //draw(lVs[1]--lVs[3],red+2bp); //draw(uVsl[0]--uVsr[0],red+2bp); [/asy] $\textbf{(A) }6\qquad\textbf{(B) }7\qquad\textbf{(C) }5+2\sqrt{2}\qquad\textbf{(D) }8\qquad\textbf{(E) }9$

Solution: Through observation, we can reasonably assume that each of the triangles on this shape is a right triangle. Since each side length of the hexagons is $1$ , the hypotenuse of the triangles would be $\sqrt2$ . Now we know the side lengths of the octagon whose area we are solving for. The octagon can be broken into nine pieces. We have four triangles whose side lengths are 1, and their hypotenuse is a side whose length is $\sqrt2$ . Next, we have $5$ $1$ by $1$ squares. The triangles each have an area of $\frac{1}{2}$ , and the squares each have an area of $1$
Then, we add these up, so we get $\boxed{7}.$

Answer: B 7
Problem: Suppose that $13$ cards numbered $1, 2, 3, \ldots, 13$ are arranged in a row. The task is to pick them up in numerically increasing order, working repeatedly from left to right. In the example below, cards $1, 2, 3$ are picked up on the first pass, $4$ and $5$ on the second pass, $6$ on the third pass, $7, 8, 9, 10$ on the fourth pass, and $11, 12, 13$ on the fifth pass. For how many of the $13!$ possible orderings of the cards will the $13$ cards be picked up in exactly two passes?
[asy] size(11cm); draw((0,0)--(2,0)--(2,3)--(0,3)--cycle); label("7", (1,1.5)); draw((3,0)--(5,0)--(5,3)--(3,3)--cycle); label("11", (4,1.5)); draw((6,0)--(8,0)--(8,3)--(6,3)--cycle); label("8", (7,1.5)); draw((9,0)--(11,0)--(11,3)--(9,3)--cycle); label("6", (10,1.5)); draw((12,0)--(14,0)--(14,3)--(12,3)--cycle); label("4", (13,1.5)); draw((15,0)--(17,0)--(17,3)--(15,3)--cycle); label("5", (16,1.5)); draw((18,0)--(20,0)--(20,3)--(18,3)--cycle); label("9", (19,1.5)); draw((21,0)--(23,0)--(23,3)--(21,3)--cycle); label("12", (22,1.5)); draw((24,0)--(26,0)--(26,3)--(24,3)--cycle); label("1", (25,1.5)); draw((27,0)--(29,0)--(29,3)--(27,3)--cycle); label("13", (28,1.5)); draw((30,0)--(32,0)--(32,3)--(30,3)--cycle); label("10", (31,1.5)); draw((33,0)--(35,0)--(35,3)--(33,3)--cycle); label("2", (34,1.5)); draw((36,0)--(38,0)--(38,3)--(36,3)--cycle); label("3", (37,1.5)); [/asy] $\textbf{(A) } 4082 \qquad \textbf{(B) } 4095 \qquad \textbf{(C) } 4096 \qquad \textbf{(D) } 8178 \qquad \textbf{(E) } 8191$

Solution: For $1\leq k\leq 12,$ suppose that cards $1, 2, \ldots, k$ are picked up on the first pass. It follows that cards $k+1,k+2,\ldots,13$ are picked up on the second pass.
Once we pick the spots for the cards on the first pass, there is only one way to arrange all $\boldsymbol{13}$ cards.
For each value of $k,$ there are $\binom{13}{k}-1$ ways to pick the $k$ spots for the cards on the first pass: We exclude the arrangement [asy] size(11cm); draw((0,0)--(2,0)--(2,3)--(0,3)--cycle); label("1", (1,1.5)); draw((3,0)--(5,0)--(5,3)--(3,3)--cycle); label("2", (4,1.5)); draw((6,0)--(8,0)--(8,3)--(6,3)--cycle); label("3", (7,1.5)); draw((9,0)--(11,0)--(11,3)--(9,3)--cycle); label("4", (10,1.5)); draw((12,0)--(14,0)--(14,3)--(12,3)--cycle); label("5", (13,1.5)); draw((15,0)--(17,0)--(17,3)--(15,3)--cycle); label("6", (16,1.5)); draw((18,0)--(20,0)--(20,3)--(18,3)--cycle); label("7", (19,1.5)); draw((21,0)--(23,0)--(23,3)--(21,3)--cycle); label("8", (22,1.5)); draw((24,0)--(26,0)--(26,3)--(24,3)--cycle); label("9", (25,1.5)); draw((27,0)--(29,0)--(29,3)--(27,3)--cycle); label("10", (28,1.5)); draw((30,0)--(32,0)--(32,3)--(30,3)--cycle); label("11", (31,1.5)); draw((33,0)--(35,0)--(35,3)--(33,3)--cycle); label("12", (34,1.5)); draw((36,0)--(38,0)--(38,3)--(36,3)--cycle); label("13", (37,1.5)); [/asy] in which the first pass consists of all $13$ cards.
Therefore, the answer is \[\sum_{k=1}^{12}\left[\binom{13}{k}-1\right] = \left[\sum_{k=1}^{12}\binom{13}{k}\right]-12 = \left[\sum_{k=0}^{13}\binom{13}{k}\right]-14 = 2^{13} - 14 = \boxed{8178}.\]

Answer: D 8178
Problem: Suppose that $13$ cards numbered $1, 2, 3, \ldots, 13$ are arranged in a row. The task is to pick them up in numerically increasing order, working repeatedly from left to right. In the example below, cards $1, 2, 3$ are picked up on the first pass, $4$ and $5$ on the second pass, $6$ on the third pass, $7, 8, 9, 10$ on the fourth pass, and $11, 12, 13$ on the fifth pass. For how many of the $13!$ possible orderings of the cards will the $13$ cards be picked up in exactly two passes?
[asy] size(11cm); draw((0,0)--(2,0)--(2,3)--(0,3)--cycle); label("7", (1,1.5)); draw((3,0)--(5,0)--(5,3)--(3,3)--cycle); label("11", (4,1.5)); draw((6,0)--(8,0)--(8,3)--(6,3)--cycle); label("8", (7,1.5)); draw((9,0)--(11,0)--(11,3)--(9,3)--cycle); label("6", (10,1.5)); draw((12,0)--(14,0)--(14,3)--(12,3)--cycle); label("4", (13,1.5)); draw((15,0)--(17,0)--(17,3)--(15,3)--cycle); label("5", (16,1.5)); draw((18,0)--(20,0)--(20,3)--(18,3)--cycle); label("9", (19,1.5)); draw((21,0)--(23,0)--(23,3)--(21,3)--cycle); label("12", (22,1.5)); draw((24,0)--(26,0)--(26,3)--(24,3)--cycle); label("1", (25,1.5)); draw((27,0)--(29,0)--(29,3)--(27,3)--cycle); label("13", (28,1.5)); draw((30,0)--(32,0)--(32,3)--(30,3)--cycle); label("10", (31,1.5)); draw((33,0)--(35,0)--(35,3)--(33,3)--cycle); label("2", (34,1.5)); draw((36,0)--(38,0)--(38,3)--(36,3)--cycle); label("3", (37,1.5)); [/asy] $\textbf{(A) } 4082 \qquad \textbf{(B) } 4095 \qquad \textbf{(C) } 4096 \qquad \textbf{(D) } 8178 \qquad \textbf{(E) } 8191$

Solution: To solve this problem, we can use recursion on $n$ . Let $A_n$ be the number of arrangements for $n$ numbers. Now, let's look at how these arrangements are formed by case work on the first number $a_1$
If $a_1 = 1$ , the remaining $n-1$ numbers from $2$ to $n$ are arranged in the same way just like number 1 to $n-1$ in the case of $n-1$ numbers. So there are $A_{n-1}$ arrangements.
If $a_1 = 2$ , then we need to choose 1 position from position 2 to $n-1$ to put 1, and all remaining numbers must be arranged in increasing order, so there are $\binom{n-1}{1}$ such arrangements.
If $a_1 = k$ , then we need to choose $k-1$ positions from position 2 to $n-1$ to put $1, 2,\cdots k-1$ , and all remaining numbers must be arranged in increasing order, so there are $\binom{n-1}{k-1}$ such arrangements.
So we can write \[A_n = A_{n-1} + \binom{n-1}{1} + \binom{n-1}{2} + \cdots + \binom{n-1}{n-1}\] which can be simplified to \[A_n = A_{n-1} + 2^{n-1} - 1\] We can solve this recursive sequence by summing up $n-1$ lines of the recursive formula \[A_n - A_{n-1} = 2^{n-1} - 1\] \[A_{n-1} - A_{n-2} = 2^{n-2} - 1\] \[\cdots\] \[A_2 - A_{1} = 2^{1} - 1\] to get \[A_n - A_1 = \sum_{k=1}^{n-1} (2^k - 1) = 2^n - 2 - (n-1) = 2^n - n - 1\] since $A_1=0$ , we have \[A_n = 2^n - n - 1\] and $A_{13} = 2^{13} - 14 = \boxed{8178}$

Answer: D 8178
Problem: Suppose that $13$ cards numbered $1, 2, 3, \ldots, 13$ are arranged in a row. The task is to pick them up in numerically increasing order, working repeatedly from left to right. In the example below, cards $1, 2, 3$ are picked up on the first pass, $4$ and $5$ on the second pass, $6$ on the third pass, $7, 8, 9, 10$ on the fourth pass, and $11, 12, 13$ on the fifth pass. For how many of the $13!$ possible orderings of the cards will the $13$ cards be picked up in exactly two passes?
[asy] size(11cm); draw((0,0)--(2,0)--(2,3)--(0,3)--cycle); label("7", (1,1.5)); draw((3,0)--(5,0)--(5,3)--(3,3)--cycle); label("11", (4,1.5)); draw((6,0)--(8,0)--(8,3)--(6,3)--cycle); label("8", (7,1.5)); draw((9,0)--(11,0)--(11,3)--(9,3)--cycle); label("6", (10,1.5)); draw((12,0)--(14,0)--(14,3)--(12,3)--cycle); label("4", (13,1.5)); draw((15,0)--(17,0)--(17,3)--(15,3)--cycle); label("5", (16,1.5)); draw((18,0)--(20,0)--(20,3)--(18,3)--cycle); label("9", (19,1.5)); draw((21,0)--(23,0)--(23,3)--(21,3)--cycle); label("12", (22,1.5)); draw((24,0)--(26,0)--(26,3)--(24,3)--cycle); label("1", (25,1.5)); draw((27,0)--(29,0)--(29,3)--(27,3)--cycle); label("13", (28,1.5)); draw((30,0)--(32,0)--(32,3)--(30,3)--cycle); label("10", (31,1.5)); draw((33,0)--(35,0)--(35,3)--(33,3)--cycle); label("2", (34,1.5)); draw((36,0)--(38,0)--(38,3)--(36,3)--cycle); label("3", (37,1.5)); [/asy] $\textbf{(A) } 4082 \qquad \textbf{(B) } 4095 \qquad \textbf{(C) } 4096 \qquad \textbf{(D) } 8178 \qquad \textbf{(E) } 8191$

Solution: When we have $3$ cards arranged in a row, after listing out all possible arrangements, we see that we have $4$ ones: $(1, 3, 2), (2, 1, 3), (2, 3, 1),$ and $(3, 1, 2)$ . When we have $4$ cards, we find $11$ possible arrangements: $(1, 2, 4, 3), (1, 3, 2, 4), (1, 3, 4, 2), (1, 4, 2, 3), (2, 1, 3, 4), (2, 3, 1, 4), (2, 3, 4, 1), (3, 1, 2, 4), (3, 1, 4, 2), (3, 4, 1, 2),$ and $(4, 1, 2, 3).$ Hence, we recognize the pattern that for $n$ cards, we have $2^n - n - 1$ valid arrangements, so our answer is $2^{13} - 13 - 1 = \boxed{8178}.$ ~eibc

Answer: D 8178
Problem: Suppose that $13$ cards numbered $1, 2, 3, \ldots, 13$ are arranged in a row. The task is to pick them up in numerically increasing order, working repeatedly from left to right. In the example below, cards $1, 2, 3$ are picked up on the first pass, $4$ and $5$ on the second pass, $6$ on the third pass, $7, 8, 9, 10$ on the fourth pass, and $11, 12, 13$ on the fifth pass. For how many of the $13!$ possible orderings of the cards will the $13$ cards be picked up in exactly two passes?
[asy] size(11cm); draw((0,0)--(2,0)--(2,3)--(0,3)--cycle); label("7", (1,1.5)); draw((3,0)--(5,0)--(5,3)--(3,3)--cycle); label("11", (4,1.5)); draw((6,0)--(8,0)--(8,3)--(6,3)--cycle); label("8", (7,1.5)); draw((9,0)--(11,0)--(11,3)--(9,3)--cycle); label("6", (10,1.5)); draw((12,0)--(14,0)--(14,3)--(12,3)--cycle); label("4", (13,1.5)); draw((15,0)--(17,0)--(17,3)--(15,3)--cycle); label("5", (16,1.5)); draw((18,0)--(20,0)--(20,3)--(18,3)--cycle); label("9", (19,1.5)); draw((21,0)--(23,0)--(23,3)--(21,3)--cycle); label("12", (22,1.5)); draw((24,0)--(26,0)--(26,3)--(24,3)--cycle); label("1", (25,1.5)); draw((27,0)--(29,0)--(29,3)--(27,3)--cycle); label("13", (28,1.5)); draw((30,0)--(32,0)--(32,3)--(30,3)--cycle); label("10", (31,1.5)); draw((33,0)--(35,0)--(35,3)--(33,3)--cycle); label("2", (34,1.5)); draw((36,0)--(38,0)--(38,3)--(36,3)--cycle); label("3", (37,1.5)); [/asy] $\textbf{(A) } 4082 \qquad \textbf{(B) } 4095 \qquad \textbf{(C) } 4096 \qquad \textbf{(D) } 8178 \qquad \textbf{(E) } 8191$

Solution: Notice that for each card "position", we can choose for it to be picked up on the first or second pass, for a total of $2^{13}$ options. However, if all of the cards selected to be picked up first are before all of the cards to be picked up second, then this means that the list is in consecutive ascending order (and thus all cards will be picked up on the first pass instead). This can happen in 14 ways, so our answer is $2^{13}-14=\boxed{8178}$

Answer: D 8178
Problem: How many strings of length $5$ formed from the digits $0$ $1$ $2$ $3$ $4$ are there such that for each $j \in \{1,2,3,4\}$ , at least $j$ of the digits are less than $j$ ? (For example, $02214$ satisfies this condition
because it contains at least $1$ digit less than $1$ , at least $2$ digits less than $2$ , at least $3$ digits less
than $3$ , and at least $4$ digits less than $4$ . The string $23404$ does not satisfy the condition because it
does not contain at least $2$ digits less than $2$ .)
$\textbf{(A) }500\qquad\textbf{(B) }625\qquad\textbf{(C) }1089\qquad\textbf{(D) }1199\qquad\textbf{(E) }1296$

Solution: For some $n$ , let there be $n+1$ parking spaces counterclockwise in a circle. Consider a string of $n$ integers $c_1c_2 \ldots c_n$ each between $0$ and $n$ , and let $n$ cars come into this circle so that the $i$ th car tries to park at spot $c_i$ , but if it is already taken then it instead keeps going counterclockwise and takes the next available spot. After this process, exactly one spot will remain empty.
Then the strings of $n$ numbers between $0$ and $n-1$ that contain at least $k$ integers $<k$ for $1 \leq k \leq n$ are exactly the set of strings that leave spot $n$ empty. Also note for any string $c_1c_2 \ldots c_n$ , we can add $1$ to each $c_i$ (mod $n+1$ ) to shift the empty spot counterclockwise, meaning for each string there exists exactly one $j$ with $0 \leq j \leq n$ so that $(c_1+j)(c_2+j) \ldots (c_n+j)$ leaves spot $n$ empty. This gives there are $\frac{(n+1)^{n}}{n+1} = (n+1)^{n-1}$ such strings.
Plugging in $n = 5$ gives $\boxed{1296}$ such strings.

Answer: E 1296
Problem: How many strings of length $5$ formed from the digits $0$ $1$ $2$ $3$ $4$ are there such that for each $j \in \{1,2,3,4\}$ , at least $j$ of the digits are less than $j$ ? (For example, $02214$ satisfies this condition
because it contains at least $1$ digit less than $1$ , at least $2$ digits less than $2$ , at least $3$ digits less
than $3$ , and at least $4$ digits less than $4$ . The string $23404$ does not satisfy the condition because it
does not contain at least $2$ digits less than $2$ .)
$\textbf{(A) }500\qquad\textbf{(B) }625\qquad\textbf{(C) }1089\qquad\textbf{(D) }1199\qquad\textbf{(E) }1296$

Solution: Note that a valid string must have at least one $0.$
We perform casework on the number of different digits such strings can have. For each string, we list the digits in ascending order, then consider permutations:
Together, the answer is $1+75+500+600+120=\boxed{1296}.$

Answer: E 1296
Problem: How many strings of length $5$ formed from the digits $0$ $1$ $2$ $3$ $4$ are there such that for each $j \in \{1,2,3,4\}$ , at least $j$ of the digits are less than $j$ ? (For example, $02214$ satisfies this condition
because it contains at least $1$ digit less than $1$ , at least $2$ digits less than $2$ , at least $3$ digits less
than $3$ , and at least $4$ digits less than $4$ . The string $23404$ does not satisfy the condition because it
does not contain at least $2$ digits less than $2$ .)
$\textbf{(A) }500\qquad\textbf{(B) }625\qquad\textbf{(C) }1089\qquad\textbf{(D) }1199\qquad\textbf{(E) }1296$

Solution: Denote by $N \left( p, q \right)$ the number of $p$ -digit strings formed by using numbers $0, 1, \cdots, q$ , where for each $j \in \{1,2, \cdots , q\}$ , at least $j$ of the digits are less than $j$
We have the following recursive equation: \[N \left( p, q \right) = \sum_{i = 0}^{p - q} \binom{p}{i} N \left( p - i, q - 1 \right) , \ \forall \ p \geq q \mbox{ and } q \geq 1\] and the boundary condition $N \left( p, 0 \right) = 1$ for any $p \geq 0$
By solving this recursive equation, for $q = 1$ and $p \geq q$ , we get \begin{align*} N \left( p , 1 \right) & = \sum_{i = 0}^{p - 1} \binom{p}{i} N \left( p - i, 0 \right) \\ & = \sum_{i = 0}^{p - 1} \binom{p}{i} \\ & = \sum_{i = 0}^p \binom{p}{i} - \binom{p}{p} \\ & = 2^p - 1 . \end{align*}
For $q = 2$ and $p \geq q$ , we get \begin{align*} N \left( p , 2 \right) & = \sum_{i = 0}^{p - 2} \binom{p}{i} N \left( p - i, 1 \right) \\ & = \sum_{i = 0}^{p - 2} \binom{p}{i} \left( 2^{p - i} - 1 \right) \\ & = \sum_{i = 0}^p \binom{p}{i} \left( 2^{p - i} - 1 \right) - \sum_{i = p - 1}^p \binom{p}{i} \left( 2^{p - i} - 1 \right) \\ & = \sum_{i = 0}^p \left( \binom{p}{i} 1^i 2^{p - i} - \binom{p}{i} 1^i 1^{p - i} \right) - p \\ & = \left( 1 + 2 \right)^p - \left( 1 + 1 \right)^p - p \\ & = 3^p - 2^p - p . \end{align*}
For $q = 3$ and $p \geq q$ , we get \begin{align*} N \left( p , 3 \right) & = \sum_{i = 0}^{p - 3} \binom{p}{i} N \left( p - i, 2 \right) \\ & = \sum_{i = 0}^{p - 3} \binom{p}{i} \left( 3^{p - i} - 2^{p - i} - \left( p - i \right) \right) \\ & = \sum_{i = 0}^p \binom{p}{i} \left( 3^{p - i} - 2^{p - i} - \left( p - i \right) \right) - \sum_{i = p - 2}^p \binom{p}{i} \left( 3^{p - i} - 2^{p - i} - \left( p - i \right) \right) \\ & = \sum_{i = 0}^p \left( \binom{p}{i} 1^i 3^{p - i} - \binom{p}{i} 1^i 2^{p - i} - \binom{p}{i} \left( p - i \right) \right) - \frac{3}{2} p \left( p - 1 \right) \\ & = \left( 1 + 3 \right)^p - \left( 1 + 2 \right)^p - \frac{d \left( 1 + x \right)^p}{dx} \bigg|_{x = 1} - \frac{3}{2} p \left( p - 1 \right) \\ & = 4^p - 3^p - 2^{p-1} p - \frac{3}{2} p \left( p - 1 \right) . \end{align*}
For $q = 4$ and $p = 5$ , we get \begin{align*} N \left( 5 , 4 \right) & = \sum_{i = 0}^1 \binom{5}{i} N \left( 5 - i , 3 \right) \\ & = N \left( 5 , 3 \right) + 5 N \left( 4 , 3 \right) \\ & = \boxed{1296}

Answer: E 1296
Problem: How many strings of length $5$ formed from the digits $0$ $1$ $2$ $3$ $4$ are there such that for each $j \in \{1,2,3,4\}$ , at least $j$ of the digits are less than $j$ ? (For example, $02214$ satisfies this condition
because it contains at least $1$ digit less than $1$ , at least $2$ digits less than $2$ , at least $3$ digits less
than $3$ , and at least $4$ digits less than $4$ . The string $23404$ does not satisfy the condition because it
does not contain at least $2$ digits less than $2$ .)
$\textbf{(A) }500\qquad\textbf{(B) }625\qquad\textbf{(C) }1089\qquad\textbf{(D) }1199\qquad\textbf{(E) }1296$

Solution: The number of strings is $(n+1)^{(n-1)}$ as shown by Solution 1 (Parking Function), which is always equivalent to 1 (mod n). Thus you can choose $\boxed{1296}$

Answer: E 1296
Problem: How many strings of length $5$ formed from the digits $0$ $1$ $2$ $3$ $4$ are there such that for each $j \in \{1,2,3,4\}$ , at least $j$ of the digits are less than $j$ ? (For example, $02214$ satisfies this condition
because it contains at least $1$ digit less than $1$ , at least $2$ digits less than $2$ , at least $3$ digits less
than $3$ , and at least $4$ digits less than $4$ . The string $23404$ does not satisfy the condition because it
does not contain at least $2$ digits less than $2$ .)
$\textbf{(A) }500\qquad\textbf{(B) }625\qquad\textbf{(C) }1089\qquad\textbf{(D) }1199\qquad\textbf{(E) }1296$

Solution: Solution 4 tried to observe the answer modulo $5$ to easily solve the problem, but apparently had faulty logic. This solution is still completely viable though:
Notice that for any valid set $\{a_1, a_2, a_3, a_4, a_5\}$ , if there is at least one element in the set that is unique (i.e. there is at least one digit in the set that is found nowhere else in the set), then the number of distinct permutations of the set is clearly divisible by $5$ . Therefore to evaluate the answer modulo $5$ , we only need to look at sets where each element has a multiplicity of at least $2$ (i.e. appears twice or more in the set).
These sets are of the form $\{a,a,b,b,b\}$ and $\{a,a,a,a,a\}$ . The first set can be permuted in $\binom{5}{2,3}=10 \equiv 0\pmod{5}$ , and the second set can be permuted one way, and the only set of the form $\{a,a,a,a,a\}$ is $\{0,0,0,0,0\}$ . Therefore the answer is congruent to $1\pmod{5}$ and you CAN choose $\boxed{1296}$

Answer: E 1296