Navvye/Olympiad-Problems-CSV huggingface dataset:
Problem: Two of the three sides of a triangle are 20 and 15. Which of the following numbers is not a possible perimeter of the triangle?
$\textbf{(A)}\ 52\qquad\textbf{(B)}\ 57\qquad\textbf{(C)}\ 62\qquad\textbf{(D)}\ 67\qquad\textbf{(E)}\ 72$

Solution: Letting $x$ be the third side, then by the triangle inequality, $20-15 < x < 20+15$ , or $5 < x < 35$ . Therefore the perimeter must be greater than 40 but less than 70. 72 is not in this range, so $\boxed{72}$ is our answer.

Answer: E 72
Problem: Integers $x$ and $y$ with $x>y>0$ satisfy $x+y+xy=80$ . What is $x$
$\textbf{(A)}\ 8 \qquad\textbf{(B)}\ 10 \qquad\textbf{(C)}\ 15 \qquad\textbf{(D)}\ 18 \qquad\textbf{(E)}\ 26$

Solution: Use SFFT to get $(x+1)(y+1)=81$ . The terms $(x+1)$ and $(y+1)$ must be factors of $81$ , which include $1, 3, 9, 27, 81$ . Because $x > y$ $x+1$ is equal to $27$ or $81$ . But if $x+1=81$ , then $y=0$ and so $x=\boxed{26}$

Answer: E 26
Problem: On a sheet of paper, Isabella draws a circle of radius $2$ , a circle of radius $3$ , and all possible lines simultaneously tangent to both circles. Isabella notices that she has drawn exactly $k \ge  0$ lines. How many different values of $k$ are possible?
$\textbf{(A)}\ 2 \qquad\textbf{(B)}\ 3 \qquad\textbf{(C)}\ 4 \qquad\textbf{(D)}\ 5\qquad\textbf{(E)}\ 6$

Solution: Isabella can get $0$ lines if the circles are concentric, $1$ if internally tangent, $2$ if overlapping, $3$ if externally tangent, and $4$ if non-overlapping and not externally tangent. There are $\boxed{5}$ values of $k$

Answer: D 5
Problem: The parabolas $y=ax^2 - 2$ and $y=4 - bx^2$ intersect the coordinate axes in exactly four points, and these four points are the vertices of a kite of area $12$ . What is $a+b$
$\textbf{(A)}\ 1\qquad\textbf{(B)}\ 1.5\qquad\textbf{(C)}\ 2\qquad\textbf{(D)}\ 2.5\qquad\textbf{(E)}\ 3$

Solution: Clearly, the parabolas must intersect the x-axis at the same two points. Their distance multiplied by $4 - (-2)$ (the distance between the y-intercepts), all divided by 2 is equal to 12, the area of the kite (half the product of the diagonals). That distance is thus 4, and so the x-intercepts are $(2, 0), (-2, 0).$ Then $0 = 4a - 2 \rightarrow a = 0.5$ , and $0 = 4 - 4b \rightarrow b = 1.$ Then $a + b = \boxed{1.5}$

Answer: B 1.5
Problem: The parabolas $y=ax^2 - 2$ and $y=4 - bx^2$ intersect the coordinate axes in exactly four points, and these four points are the vertices of a kite of area $12$ . What is $a+b$
$\textbf{(A)}\ 1\qquad\textbf{(B)}\ 1.5\qquad\textbf{(C)}\ 2\qquad\textbf{(D)}\ 2.5\qquad\textbf{(E)}\ 3$

Solution: The parabolas must intersect the x-axis at the same two points for the kite to form. We find the x values at which they intersect by equating them and solving for x as shown below. $y = ax^2-2$ and $y = 4 - bx^2\rightarrow ax^2-2 = 4-bx^2\rightarrow (a+b)x^2 = 6 \rightarrow x = +\sqrt{\dfrac{6}{a+b}}$ or $-\sqrt{\dfrac{6}{a+b}}$ . The x-values of the y-intercepts is 0, so we plug in zero in each of them and get $-2$ and $4$ . The area of a kite is $\dfrac{d_1*d_2}{2}$ . The $d_1$ is $2+4 = 6$ . The $d_2$ is $2\sqrt{\dfrac{6}{a+b}}$ . Solving for the area $\rightarrow \dfrac{1}{2}*(6)*(2*\sqrt{\dfrac{6}{a+b}}) = 12 \rightarrow (2*\sqrt{\dfrac{6}{a+b}}) = 4 \rightarrow (\sqrt{\dfrac{6}{a+b}}) = 2 \rightarrow \dfrac{6}{a+b} = 4 \rightarrow  \dfrac{6}{4} = (a+b)$ , therefore $a + b = \boxed{1.5}$

Answer: B 1.5
Problem: What is the minimum number of digits to the right of the decimal point needed to express the fraction $\frac{123456789}{2^{26}\cdot 5^4}$ as a decimal?
$\textbf{(A)}\ 4\qquad\textbf{(B)}\ 22\qquad\textbf{(C)}\ 26\qquad\textbf{(D)}\ 30\qquad\textbf{(E)}\ 104$

Solution: We can rewrite the fraction as $\frac{123456789}{2^{22} \cdot 10^4} = \frac{12345.6789}{2^{22}}$ . Since the last digit of the numerator is odd, a $5$ is added to the right if the numerator is divided by $2$ , and this will continuously happen because $5$ , itself, is odd. Indeed, this happens twenty-two times since we divide by $2$ twenty-two times, so we will need $22$ more digits. Hence, the answer is $4 + 22 = \boxed{26}$

Answer: C 26
Problem: What is the minimum number of digits to the right of the decimal point needed to express the fraction $\frac{123456789}{2^{26}\cdot 5^4}$ as a decimal?
$\textbf{(A)}\ 4\qquad\textbf{(B)}\ 22\qquad\textbf{(C)}\ 26\qquad\textbf{(D)}\ 30\qquad\textbf{(E)}\ 104$

Solution: Multiply the numerator and denominator of the fraction by $5^{22}$ (which is the same as multiplying by 1) to give $\frac{5^{22} \cdot 123456789}{10^{26}}$ . Now, instead of thinking about this as a fraction, think of it as the division calculation $(5^{22} \cdot 123456789) \div 10^{26}$ . The dividend is a huge number, but we know it doesn't have any digits to the right of the decimal point. Also, the dividend is not a multiple of 10 (it's not a multiple of 2), so these 26 divisions by 10 will each shift the entire dividend one digit to the right of the decimal point. Thus, $\boxed{26}$ is the minimum number of digits to the right of the decimal point needed.

Answer: C 26
Problem: What is the minimum number of digits to the right of the decimal point needed to express the fraction $\frac{123456789}{2^{26}\cdot 5^4}$ as a decimal?
$\textbf{(A)}\ 4\qquad\textbf{(B)}\ 22\qquad\textbf{(C)}\ 26\qquad\textbf{(D)}\ 30\qquad\textbf{(E)}\ 104$

Solution: The denominator is $10^4 \cdot 2^{22}$ . Each $10$ adds one digit to the right of the decimal, and each additional $2$ adds another digit. The answer is $4 + 22 = \boxed{26}$

Answer: C 26
Problem: The zeros of the function $f(x) = x^2-ax+2a$ are integers. What is the sum of the possible values of $a$
$\textbf{(A)}\ 7 \qquad\textbf{(B)}\ 8 \qquad\textbf{(C)}\ 16 \qquad\textbf{(D)}\ 17 \qquad\textbf{(E)}\ 18$

Solution: The problem asks us to find the sum of every integer value of $a$ such that the roots of $x^2 - ax + 2a = 0$ are both integers.
The quadratic formula gives the roots of the quadratic equation: $x=\frac{a\pm\sqrt{a^2-8a}}{2}$
As long as the numerator is an even integer, the roots are both integers. But first of all, the radical term in the numerator needs to be an integer; that is, the discriminant $a^2 - 8a$ equals $k^2$ , for some nonnegative integer $k$
$a^2-8a=k^2$
$a(a-8)=k^2$
$((a-4)+4)((a-4)-4)=k^2$
$(a-4)^2-4^2=k^2$
$(a-4)^2=k^2+4^2$
From this last equation, we are given a hint of the Pythagorean theorem. Thus, $(k,4,|a-4|)$ must be a Pythagorean triple unless $k = 0$
In the case $k=0$ , the equation simplifies to $|a-4|=4$ . From this equation, we have $a=0,8$ . For both $a=0$ and $a=8$ $\frac{a\pm\sqrt{a^2-8a}}{2}$ yields two integers, so these values satisfy the constraints from the original problem statement. (Note: the two zero roots count as "two integers.")
If $k$ is a positive integer, then only one Pythagorean triple could match the triple $(k,4,|a - 4|)$ because the only Pythagorean triple with a $4$ as one of the values is the classic $(3,4,5)$ triple. Here, $k=3$ and $|a-4|=5$ . Hence, $a=-1,9$ . Again, $\frac{a\pm\sqrt{a^2-8a}}{2}$ yields two integers for both $a=-1$ and $a=9$ , so these two values also satisfy the original constraints.
There are a total of four possible values for $a$ $-1,0,8,$ and $9$ . Hence, the sum of all of the possible values of $a$ is $\boxed{16}$

Answer: C 16
Problem: The zeros of the function $f(x) = x^2-ax+2a$ are integers. What is the sum of the possible values of $a$
$\textbf{(A)}\ 7 \qquad\textbf{(B)}\ 8 \qquad\textbf{(C)}\ 16 \qquad\textbf{(D)}\ 17 \qquad\textbf{(E)}\ 18$

Solution: By the quadratic formula, the roots $r$ can be represented by \[r=\frac{a\pm\sqrt{a^2-8a}}{2}\] For $r\in\mathbb{Z}$ $a\in\mathbb{Z}$ , since $\frac{\sqrt{a^2-8a}}{2}$ and $\frac{a}{2}$ will have different mantissas (mantissae?).
Now observe the discriminant $\sqrt{a^2-8a}=\sqrt{a(a-8)}$ and have two cases.
Positive $a$
$a\geq8$ and $a\leq0$ , since $1\geq a \geq7$ gives imaginary roots. Testing positive $a$ values, quickly see that $a\leq9$ . After $16$ and $36$ , the difference between the closest nonzero factor pairs of perfect squares exceeds $8$ . For $8\geq a \geq9$ $a=8,9$ . Checking both yields an integer.
Negative $a$
We can instead test with $\sqrt{-a(8-a)}$ . If $b=8-a$ , we have our original expression. Thus, for the same reasons, $b=8,9\implies 8,9=8-a$ $a=-1$ (0 does not affect the answer).
$-1+8+9=16\implies\boxed{16}$

Answer: C 16
Problem: The zeros of the function $f(x) = x^2-ax+2a$ are integers. What is the sum of the possible values of $a$
$\textbf{(A)}\ 7 \qquad\textbf{(B)}\ 8 \qquad\textbf{(C)}\ 16 \qquad\textbf{(D)}\ 17 \qquad\textbf{(E)}\ 18$

Solution: Let $m$ and $n$ be the roots of $x^2-ax+2a$
By Vieta's Formulas, $n+m=a$ and $mn=2a$
Substituting gets us $n+m=\frac{mn}{2}$
$2n-mn+2m=0$
Using Simon's Favorite Factoring Trick:
$n(2-m)+2m=0$
$-n(2-m)-2m=0$
$-n(2-m)-2m+4=4$
$(2-n)(2-m)=4$
This means that the values for $(m,n)$ are $(0,0),(4,4),(3,6),(1,-2)$ giving us $a$ values of $-1,0,8,$ and $9$ . Adding these up gets $\boxed{16}$

Answer: C 16
Problem: The zeros of the function $f(x) = x^2-ax+2a$ are integers. What is the sum of the possible values of $a$
$\textbf{(A)}\ 7 \qquad\textbf{(B)}\ 8 \qquad\textbf{(C)}\ 16 \qquad\textbf{(D)}\ 17 \qquad\textbf{(E)}\ 18$

Solution: The quadratic formula gives \[x = \frac{a \pm \sqrt{a(a-8)}}{2}\] . For $x$ to be an integer, it is necessary (and sufficient!) that $a(a-8)$ to be a perfect square. So we have $a(a-8) = b^2$ ; this is a quadratic in itself and the quadratic formula gives \[a = 4 \pm \sqrt{16 + b^2}\]
We want $16 + b^2$ to be a perfect square. From smartly trying small values of $b$ , we find $b = 0, b = 3$ as solutions, which correspond to $a = -1, 0, 8, 9$ . These are the only ones; if we want to make sure then we must hand check up to $b=8$ . Indeed, for $b \geq 9$ we have that the differences between consecutive squares are greater than $16$ so we can't have $b^2 + 16$ be a perfect square. So summing our values for $a$ we find $\boxed{16}$ . as the answer.

Answer: C 16
Problem: The zeros of the function $f(x) = x^2-ax+2a$ are integers. What is the sum of the possible values of $a$
$\textbf{(A)}\ 7 \qquad\textbf{(B)}\ 8 \qquad\textbf{(C)}\ 16 \qquad\textbf{(D)}\ 17 \qquad\textbf{(E)}\ 18$

Solution: First of all, we know that $a$ is the sum of the quadratic's two roots, by Vieta's formulas. Thus, $a$ must be an integer. Then, we notice that the discriminant $a^2-8a$ must be equal to a perfect square so that the roots are integers. Thus, $a(a-8)=b^2$ where $b$ is an integer.
We can complete the square and rearrange to get $(a-4)^2-b^2=16$ . Let's define $m=a-4$ , just to make things a little easier to write, so now we have $(m+b)(m-b)=16$ . We can now list out the integer factor pairs of 16 and the resulting values of $m$ and $b$ . (Note that $m$ and $b$ must both be integers)
$(m+b)(m-b)=16$
$16*1=16$ $\Rightarrow$ Doesn't work
$8*2=16$ $\Rightarrow$ $m=5, b=3$
$4*4=16$ $\Rightarrow$ $m=4, b=0$
$2*8=16$ $\Rightarrow$ $m=5, b=-3$
$1*16=16$ $\Rightarrow$ Doesn't work
$-16*-1=16$ $\Rightarrow$ Doesn't work
$-8*-2=16$ $\Rightarrow$ $m=-5, b=-3$
$-4*-4=16$ $\Rightarrow$ $m=-4, b=0$
$-2*-8=16$ $\Rightarrow$ $m=-5, b=-3$
$-1*-16=16$ $\Rightarrow$ Doesn't work
We want the possible values of $m$ , which are $-5,-4,4,$ and $5$ . As $m+4=a$ $a$ can equal $-1,0,8,$ or $9.$ Adding all of that up gets us our answer, $\boxed{16}$

Answer: C 16
Problem: Isosceles triangles $T$ and $T'$ are not congruent but have the same area and the same perimeter.  The sides of $T$ have lengths $5$ $5$ , and $8$ , while those of $T'$ have lengths $a$ $a$ , and $b$ .  Which of the following numbers is closest to $b$
$\textbf{(A) }3\qquad\textbf{(B) }4\qquad\textbf{(C) }5\qquad\textbf{(D) }6\qquad\textbf{(E) }8$

Solution: The area of $T$ is $\dfrac{1}{2} \cdot 8 \cdot 3 = 12$ and the perimeter is 18.
The area of $T'$ is $\dfrac{1}{2} b \sqrt{a^2 - (\dfrac{b}{2})^2}$ and the perimeter is $2a + b$
Thus $2a + b = 18$ , so $2a = 18 - b$
Thus $12 = \dfrac{1}{2} b \sqrt{a^2 - (\dfrac{b}{2})^2}$ , so $48 = b \sqrt{4a^2 - b^2} = b \sqrt{(18 - b)^2 - b^2} = b \sqrt{324 - 36b}$
We square and divide 36 from both sides to obtain $64 = b^2 (9 - b)$ , so $b^3 - 9b^2 + 64 = 0$ . Since we know $b = 8$ is a solution, we divide by $b - 8$ to get the other solution. Thus, $b^2 - b - 8 = 0$ , so $b = \dfrac{1 + \sqrt{33}}{2} < \dfrac{1 + 6}{2} = 3.5.$ The answer is $\boxed{3}$

Answer: A 3
Problem: Isosceles triangles $T$ and $T'$ are not congruent but have the same area and the same perimeter.  The sides of $T$ have lengths $5$ $5$ , and $8$ , while those of $T'$ have lengths $a$ $a$ , and $b$ .  Which of the following numbers is closest to $b$
$\textbf{(A) }3\qquad\textbf{(B) }4\qquad\textbf{(C) }5\qquad\textbf{(D) }6\qquad\textbf{(E) }8$

Solution: The area is $12$ , the semiperimeter is $9$ , and $a = 9 - \frac12b$ . Using Heron's formula, $\sqrt{9\left(\frac{b}{2}\right)\left(\frac{b}{2}\right)(9-b)} = 12$ . Squaring both sides and simplifying, we have $-b^3+9b^2-64=0$ . Since we know $b = 8$ is a solution, we divide by $b - 8$ to get the other solution. Thus, $b^2 - b - 8 = 0$ , so $b = \dfrac{1 + \sqrt{33}}{2} < \dfrac{1 + 6}{2} = 3.5.$ The answer is $\boxed{3}$

Answer: A 3
Problem: Isosceles triangles $T$ and $T'$ are not congruent but have the same area and the same perimeter.  The sides of $T$ have lengths $5$ $5$ , and $8$ , while those of $T'$ have lengths $a$ $a$ , and $b$ .  Which of the following numbers is closest to $b$
$\textbf{(A) }3\qquad\textbf{(B) }4\qquad\textbf{(C) }5\qquad\textbf{(D) }6\qquad\textbf{(E) }8$

Solution: Triangle $T$ , being isosceles, has an area of $\frac{1}{2}(8)\sqrt{5^2-4^2}=12$ and a perimeter of $5+5+8=18$ .
Triangle $T'$ similarly has an area of $\frac{1}{2}(b)\bigg(\sqrt{a^2-\frac{b^2}{4}}\bigg)=12$ and $2a+b=18$
Now we apply our computational fortitude.
\[\frac{1}{2}(b)\bigg(\sqrt{a^2-\frac{b^2}{4}}\bigg)=12\] \[(b)\bigg(\sqrt{a^2-\frac{b^2}{4}}\bigg)=24\] \[(b)\sqrt{4a^2-b^2}=48\] \[b^2(4a^2-b^2)=48^2\] \[b^2(2a+b)(2a-b)=48^2\] Plug in $2a+b=18$ to obtain \[18b^2(2a-b)=48^2\] \[b^2(2a-b)=128\] Plug in $2a=18-b$ to obtain \[b^2(18-2b)=128\] \[2b^3-18b^2+128=0\] \[b^3-9b^2+64=0\] We know that $b=8$ is a valid solution by $T$ . Factoring out $b-8$ , we obtain \[(b-8)(b^2-b-8)=0 \Rightarrow b^2-b-8=0\] Utilizing the quadratic formula gives \[b=\frac{1\pm\sqrt{33}}{2}\] We clearly must pick the positive solution. Note that $5<\sqrt{33}<6$ , and so ${3<\frac{1+\sqrt{33}}{2}<\frac{7}{2}}$ , which clearly gives an answer of $\boxed{3}$ , as desired.

Answer: A 3
Problem: Isosceles triangles $T$ and $T'$ are not congruent but have the same area and the same perimeter.  The sides of $T$ have lengths $5$ $5$ , and $8$ , while those of $T'$ have lengths $a$ $a$ , and $b$ .  Which of the following numbers is closest to $b$
$\textbf{(A) }3\qquad\textbf{(B) }4\qquad\textbf{(C) }5\qquad\textbf{(D) }6\qquad\textbf{(E) }8$

Solution: Triangle T has perimeter $5 + 5 + 8 = 18$ so $18 = 2a + b$
Using Heron's, we get $\sqrt{(9)(4)^2(1)} = \sqrt{(\frac{2a+b}{2})\left(\frac{b}{2}\right)^2(\frac{2a-b}{2})}$
We know that $2a + b = 18$ from above so we plug that in, and we also know that then $2a - b = 18 - 2b$
$12 = \frac{3b}{2}\sqrt{9-b}$
$64 = 9b^2 - b^3$
We plug in 3 for $b$ in the LHS, and we get 54 which is too low. We plug in 4 for $b$ in the LHS, and we get 80 which is too high. We now know that $b$ is some number between 3 and 4.
If $b \geq 3.5$ , then we would round up to 4, but if $b < 3.5$ , then we would round down to 3. So let us plug in 3.5 for $b$
We get $67.375$ which is too high, so we know that $b < 3.5$
Thus the answer is $\boxed{3}$

Answer: A 3
Problem: Isosceles triangles $T$ and $T'$ are not congruent but have the same area and the same perimeter.  The sides of $T$ have lengths $5$ $5$ , and $8$ , while those of $T'$ have lengths $a$ $a$ , and $b$ .  Which of the following numbers is closest to $b$
$\textbf{(A) }3\qquad\textbf{(B) }4\qquad\textbf{(C) }5\qquad\textbf{(D) }6\qquad\textbf{(E) }8$

Solution: For this new triangle, say its legs have length $d$ and the base length $2c$ . To see why I did this, draw the triangle on a Cartesian plane where the altitude is part of the y-axis! Then, we notice that $c+d=9$ and $c*\sqrt{d^2-c^2}=12$ . It's better to let a side be some variable so we avoid having to add non-square roots and square-roots!!
Now, modify the square-root equation with $d=9-c$ ; you get $c^2*(81-18c)=144$ , so $-18c^3+81c^2=144$ . Divide by $-9$ to get $2c^3-9c^2+16=0$ . Obviously, $c=4$ is a root as established by triangle $T$ ! So, use synthetic division to obtain $2c^2-c-4=0$ , upon which $c=\frac{1+\sqrt{33}}{4}$ , which is closest to $\frac{3}{2}$ (as opposed to $2$ ). That's enough to confirm that the answer has to be $\boxed{3}$

Answer: A 3
Problem: Isosceles triangles $T$ and $T'$ are not congruent but have the same area and the same perimeter.  The sides of $T$ have lengths $5$ $5$ , and $8$ , while those of $T'$ have lengths $a$ $a$ , and $b$ .  Which of the following numbers is closest to $b$
$\textbf{(A) }3\qquad\textbf{(B) }4\qquad\textbf{(C) }5\qquad\textbf{(D) }6\qquad\textbf{(E) }8$

Solution: Since triangles $T'$ and $T$ have the same area and the same perimeter, $2a+b=18$ and $9*(9-a)^2(9-b) = 9*4^2*1$ By trying each answer choice, it is clear that the answer is $\boxed{3}$

Answer: A 3
Problem: For each positive integer $n$ , let $S(n)$ be the number of sequences of length $n$ consisting solely of the letters $A$ and $B$ , with no more than three $A$ s in a row and no more than three $B$ s in a row. What is the remainder when $S(2015)$ is divided by $12$
$\textbf{(A)}\ 0\qquad\textbf{(B)}\ 4\qquad\textbf{(C)}\ 6\qquad\textbf{(D)}\ 8\qquad\textbf{(E)}\ 10$

Solution: The huge $n$ value in place, as well as the "no more than... in a row" are key phrases that indicate recursion is the right way to go. 
Let's go with finding the case of $S(n)$ from previous cases.
So how can we make the words of $S(n)$ ? Do we choose 3-in-a-row of one letter, $A$ or $B$ , or do we want $2$ consecutive ones or $1$ ? Note that this covers all possible cases of ending with $A$ and $B$ with a certain number of consecutive letters. And obviously they are all distinct.
[Convince yourself that each case for $S(n)$ is considered exactly once by using these cues: does it end in $3$ $2$ , or $1$ consecutive letter(s) ( $1$ consecutive means a string like ... $BA$ , ... $AB$ , as in the letter switches) and does it $WLOG$ consider both $A$ and $B?$
From there we realize that $S(n)=S(n-1)+S(n-2)+S(n-3)$ because 3 in a row requires $S(n-3)$ , and so on. We need to find $S(2015)$ mod 12. We first compute $S(2015)$ mod $3$ and mod $4$ . By listing out the residues mod $3$ , we find that the cycle length for mod $3$ is $13$ $2015$ is $0$ mod $13$ so $S(2015) = S(13) = 2$ mod $3$ . By listing out the residues mod $4$ , we find that the cycle length for mod $4$ is $4$ . S(2015) = S(3) = mod $4$ . By Chinese Remainder Theorem, $S(2015) =\boxed{8}$ mod $12$

Answer:  8
Problem: For each positive integer $n$ , let $S(n)$ be the number of sequences of length $n$ consisting solely of the letters $A$ and $B$ , with no more than three $A$ s in a row and no more than three $B$ s in a row. What is the remainder when $S(2015)$ is divided by $12$
$\textbf{(A)}\ 0\qquad\textbf{(B)}\ 4\qquad\textbf{(C)}\ 6\qquad\textbf{(D)}\ 8\qquad\textbf{(E)}\ 10$

Solution: We can start off by finding patterns in $S(n)$ . When we calculate a few values we realize either from performing the calculation or because the calculation was performed in the exact same way that $S(n) = 2^n - 2((n_4)- (n_5) \dots (n_n))$ . Rearranging the expression we realize that the terms aside from $2^{2015}$ are congruent to $0$ mod $12$ (Just put the equation in terms of 2^{2015} and the four combinations excluded and calculate the combinations mod $12$ ). Using patterns we can see that $2^{2015}$ is congruent to $8$ mod $12$ . Therefore $\boxed{8}$ is our answer.

Answer:  8
Problem: Let $S$ be a square of side length 1. Two points are chosen independently at random on the sides of $S$ . The probability that the straight-line distance between the points is at least $\frac12$ is $\frac{a-b\pi}{c}$ , where $a,b,$ and $c$ are positive integers and $\text{gcd}(a,b,c) = 1$ . What is $a+b+c$
$\textbf{(A)}\ 59 \qquad\textbf{(B)}\ 60 \qquad\textbf{(C)}\ 61 \qquad\textbf{(D)}\ 62 \qquad\textbf{(E)}\ 63$

Solution: WLOG, let the first point be on the bottom side of the square. The points where the second point could exist are outside a circle of radius 0.5 centered on the first point. The parts of the square that lie in this circle are the distance from the point to the closest side of the square $n$ , the distance from the point to the outside of the circle (the radius $0.5$ ), and any portion of the nearest side that lies within the circle as represented by the Pythagorean Theorem $\sqrt{\frac{1}{4}-n^2}$ . Thus, the total length the second point can exist in can be represented by $f(n)=4-(0.5+n+\sqrt{\frac{1}{4}-n^2})$ . Distributing, $f(n)=3.5-n-\sqrt{\frac{1}{4}-n^2}$
Then, we can find the average of this function through calculus (wow more calc?). This formula is as follows, \[\frac{1}{a_{f} -a_{i}} \int_{a_{i}}^{a_{f}} f(x)\;dx\]
For this case, the limits of integration are $0$ and $0.5$ $0\leq n\leq 0.5$ ). Then, we have,
\[2\int_{0}^{\frac{1}{2}} 3.5-n-\sqrt{\frac{1}{4}-n^2}\;dn\] \[2(\int_{0}^{\frac{1}{2}} 3.5\;dn -\int_{0}^{\frac{1}{2}}n\;dn -\int_{0}^{\frac{1}{2}}\sqrt{\frac{1}{4}-n^2}\;dn)\]
Even if you don't know how to integrate, as long as you know the idea of integration, you can figure these out. Graphing the first two, you can see that the first is a rectangle of length $0.5$ and width $3.5$ . The second is an isosceles right triangle of leg length $0.5$
\[\int_{0}^{\frac{1}{2}} 3.5\;dn=\frac{7}{4}, \int_{0}^{\frac{1}{2}}n\;dn=\frac{1}{8}\]
Recognize that the third integral is a semicircle of radius $0.5$ and centered at the origin. This is where $\pi$ comes in. From $0$ to $0.5$ , the integral is simply a quarter circle. $\frac{\frac{1}{2}^2\pi}{4}=\frac{\pi}{16}$ \[\int_{0}^{\frac{1}{2}}\sqrt{\frac{1}{4}-n^2}\;dn)=\frac{\pi}{16}\]
If you want me to actually integrate these, look below. Do note that this is for those that have a limited knowledge of integration or those that have little time but are being very clever.
Overall, where second point could lie to satisfy the problem is a length of $2(\frac{7}{4}-\frac{\pi}{16}-\frac{1}{8})=\frac{26-\pi}{8}$ . By contrast, the total length where it could lie is the perimeter of the square $4$ . So the possible points that the second point could be make up $\frac{\frac{26-\pi}{8}}{4}=\frac{26-\pi}{32}$ of the square's perimeter. Obviously, $\gcd(32, 26, 1)=1$ $32+26+1=59\implies\boxed{59}$

Answer: A 59