You are on page 1of 26

BCA Math Team

Author:
Kelvin Wang

Author:
Alexander Katz

Whats a triangle? (Definitions)

A triangle is a shape with three vertices and three edges. Because all polygons can be thought of as
combinations of triangles, it can be considered (one of) the fundamental shape(s) in geometry.

Decomposition of n-gons into triangles for n = 4, 5, 6.

Before we can explore some basic triangle facts, we need to establish some definitions (it is assumed
that you are familiar with the terms vertex, edge, angle, area, and perimeter; speak up
otherwise):
1. A right angle is one that measures 90 . Two lines that form a right angle are perpendicular,
denoted by the symbol .
2. A right triangle is one where an angle of the triangle is exactly 90 .
3. An acute triangle is one in which all three angles are less than 90 .
4. An obtuse triangle is one in which some angle is greater than 90 .
5. The foot of the altitude from a point X to a line ` is the point Y on ` such that XY `. The
altitude is the line segment XY . Of course, there are three of these in any given triangle.
6. The perpendicular bisector of a line segment AB, usually a side of a triangle, is the line
through the midpoint of AB that is perpendicular to AB. Like before, there are three of these
in any triangle.
7. The median from A to BC is the line segment from A to the midpoint of BC. Once again,
there are three of these in any triangle.
8. An angle bisector of an angle formed by the lines AB and BC is the line ` that divides the
angle into two equal angles; i.e. for any point D on `, ABD = CBD. As you might have
guessed, there are three of these in each triangle.
We can quickly prove that the angles of a triangle sum up to 180 , so of course it is impossible for a
triangle to have two right angles (or two obtuse angles). Though its beyond our scope to prove this
today, it is also true that
The three altitudes of a triangle meet at a single point - the orthocenter
The three medians of a triangle meet at a single point as well - the centroid
The three perpendicular bisectors of a triangle meet at a single point - the circumcenter. This
is also the center of the circle going through the points A, B, and C, hence its namesake.
1

October 18, 2014

The three angle bisectors of a triangle meet at a single point - the incenter. This is also the
center of the circle tangent to all three sides of the triangle, hence its namesake.
Well investigate these another time.

Parts of a triangle

Why do we care?

Since we can further subdivide triangles into two right triangles, it makes sense to deal with those
first. Specifically, lets look at a triangle ABC so that ACB = 90 . By convention, we denote
AB = c, BC = a, CA = b - the lowercase version of the letter the side is opposite. The first immediate
result is
Theorem 2.1. The area of this triangle is

ab
.
2

As a direct corollary,
Theorem 2.2. Let h be the length of the altitude from A to BC in any triangle ABC. Then
[ABC] =

BC h
2

where [ABC] is the area of triangle ABC. BC is often referred to as the base.
Notice that considering other altitudes leads to the same result. For example, [ABC] =
h is the altitude from B to AC.
Less obviously, but much more important, is the Pythagorean Theorem:

AC h
if
2

October 18, 2014

Theorem 2.3 (Pythagorean Theorem). In a right triangle with legs a, b and hypotenuse (longest side)
c, the relation
a2 + b2 = c2
holds. The converse holds as well - if a, b, c are the sides of a triangle such that a2 + b2 = c2 , then the
triangle is right.
(Well prove this after looking at similar triangles)
Some special cases of this crop up often on the AMC, the 30-60-90 triangle being the most
important. Also coming up on occasion is the 45-45-90 triangle, also known as an isosceles right
triangle (due to being both isosceles and right).
Theorem 2.4. In a triangle with ABC = 30 , BCA = 90 , CAB = 60 , we have AC : BC :

In other words, if AC = s, then BC = s and AB = s 2.

These readily extend to situations where they wouldnt seem to apply at all:

s2 3
.
Theorem 2.5. The area of an equilateral triangle with side length s is
4
This quickly extends to

3s2 3
Theorem 2.6. The area of a regular hexagon with side length s is
2

Similar Triangles

Though almost all triangles are different, oftentimes we are concerned only with their shape (rather
than their size). For example, though an equilateral triangle with side length 1 is clearly different
from an equilateral triangle with side length 9001, much of what we say about them applies regardless.
This makes sense, since they are simply scaled versions of each other. More formally, we call them
similar triangles. Of course, this does not apply only to equilateral triangles - any two triangles
that are scaled are said to be similar. More specifically,
Definition 3.1. Two triangles ABC and DEF are similar if their angles are the same, i.e. ABC =
DEF, BCA = EF D, and CAB = F ED. We write this as 4ABC 4DEF . Notice that
the order of the vertices is important - if 4ABC 4DEF , then 4ABC is not similar to 4F ED.
Since the three angles of a triangle always sum to 180 regardless of size, knowing that two
corresponding angles are equal is sufficient to determine similarity. Because parallel lines often result
in equal angles, they are your best friend for determining similarity. Of course, its still unclear why
we care. We care because:
Theorem 3.1. If 4ABC 4DEF , then
AB
BC
CA
=
=
.
DE
EF
FD
One very important corollary is that
Theorem 3.2. Let ABC be a right triangle with ACB = 90 , and let D be the altitude from C to
We can use this to directly prove the Pythagorean theorem above.
3

October 18, 2014

Example Problems

Problem 4.1. Two of the sides of a triangle are 13 and 21, and the area of the triangle is 126. Find
the length of the third side.
Solution. Let the triangle be ABC with AB = 13, BC = 21, and CA the desired side. Since we know
the area of the triangle, we can easily determine the altitude (or height) of the triangle, so lets drop
an altitude from A to BC and call the foot of it D. Then
252
2
21
Since AD = 12 and AB = 13, we have
AB 2 = AD2 + BD2 = 132 = 122 + BD2 = BD = 5
and so CD = 21 5 = 16. Finally,
AC 2 = AD2 + CD2 = 122 + 162 = 400 = AC 2 = 20 .

Problem 4.2. Equilateral 4ABC has side length 1, and squares ABDE, BCHI, CAF G lie outside
the triangle. What is the area of hexagon DEF GHI?

Solution. Since BAC = 60 (as 4ABC is equilateral), and EAB = F AC = 90 (since both
ABDE and CAF G are squares), EAF = 360 60 90 90 = 120 . Thus, as EA = AF ,
AEF = AF E = 30 . Now we can use our knowledge of 30 60 90 triangles! This immediately

1
3
tells us that the altitude from A to EF has half the length of AE, or , hence half of EF is
and
2
2
1

3 2
3
12 3
3
EF = 3. Finally, the area of EAF is
=
. Since the area of 4ABC is
=
, the
2
4
4
4
total area of the hexagon is

3
[DEF GHI] = [ABC] + 3[ABDE] + 3[AEF ] =
+ 3(1) + 3
4

3
= 3+ 3 .
4

Problem Set

1. In triangle ABC, ABC = 105 and BAC = 45 . If AB = 21 2, find BC.

2. The two legs of a right triangle, which are altitudes, have lengths 2 3 and 6. How long is the
third altitude of the triangle? (AMC 10)
3. 4ABC is a right triangle with right angle B, and regular hexagons P1 , P2 , P3 are constructed
outside ABC such that AB is a side of P1 , BC is a side of P2 , and P3 is a side of CA. If the
area of P1 is 16 and the area of P2 is 36, find the area of P3 . (JHMMC)
4. Points D, E, F, and G lie outside unit square ABCD such that ADB, BEC, CF D, and DGA
are all equilateral triangles. Find the area of square DEF G. (JHMMC)
5. Three unit circles are each externally tangent to each other. Find the area of the smallest
equilateral triangle that contains each of these circles. (JHMMC)
6. In 4ABC, AB = AC = 28 and BC = 20. Points D, E, and F are on sides AB, BC, and
AC, respectively, such that DE and EF are parallel to AC and AB, respectively. What is the
perimeter of parallelogram ADEF ? (AMC 10)
7. Two sides of a triangle have lengths 10 and 15. The length of the altitude to the third side is
the average of the lengths of the altitudes to the two given sides. How long is the third side?
(AMC 10)

8. Two equilateral triangles are contained in a square whose side length is 2 3. The bases of these
triangles are the opposite sides of the square, and their intersection is a rhombus. What is the
area of the rhombus? (AMC 10)
9. Three unit squares and two line segments connecting two pairs of vertices are shown. What is
the area of 4ABC? (AMC 10)

10. Six regular hexagons surround a regular hexagon of side length 1 as shown. What is the area of
4ABC? (AMC 10)

Introductory Number Theory

December 6, 2014

Divisibility

At some point, you were certainly asked to perform some basic division. Perhaps it was phrased in
terms of dividing candy into groups, or putting passengers on trains, or one of many other contrived
scenarios. Either way, it probably quickly became clear that some numbers couldnt be divided - 5
candies cant be divided evenly amongst two people, 6 passengers wont evenly distribute amongst 4
trains, and so on. Of course, the simplest resolution to this is allowing the use of fractions or decimals,
but this usually isnt particularly enlightening.
Lets see if we can figure out when such division is possible. Well say that
Definition 1.1. a divides b if

b
is an integer.
a

Equivalently, we say that a is a factor or divisor of b, b is a multiple of a, b is divisible by a,

or a | b. For example, 2 and 3 both divide 6, but 4 6| 6. The most important interpretation of this
definition is that
Definition 1.2. a divides b if and only if there exists an integer k such that ak = b.
Divisibility satisfies many of the same rules that basic computation does, but their converses are
not generally true. For example,
Problem 1.1. Suppose a divides b and a divides c. Show that a divides b + c.
We can easily generalize this to
Problem 1.2. Suppose a divides b and a divides c. Show that a divides b + 2c, b + 3c, 2b + 2c, b c,
and 1947283b + 923876c. In general, for any integers x, y, show that a divides xb + yc.
Note that this does not hold in reverse. If a divides b + c, it does not imply that a divides b and
a divides c. For example, 4 divides 2 + 6, but 4 divides neither 2 nor 6.
Problem 1.3. Show that if a divides b and b divides c, then a divides c.
Its worth noting that while divisibility satifies all these nice properties, non-divisibility does not
tend to play as nicely. For example, if a does not divide b and a does not divide c, it doesnt necessarily
follow that a doesnt divide b + c.
Problem 1.4. Find an example of a, b, c such that a divides b + c, but a does not divide b or c.
These properties may seem elementary, but we often use them without really thinking about them.
Oftentimes they can serve to simplify problems, such as the following two examples:
Problem 1.5. Does 3 divide 3 + 6 + 9 + 12 + . . . + 2013?
Problem 1.6. Does 37 divide 111111?
Of course, it is highly unlikely that a contest problem, particularly on the AMC, will ask such a
question. But knowing that 3 divides 3 + 6 + 9 + . . . + 2013 is a necessary prequisite to writing it as
3(1 + 2 + 3 + . . . + 671), important for a variety of reasons, and knowing that 37 divides 111111 is a
necessary prequisite to prime factorizing 111111 - precipitating our next round of questions.

December 6, 2014

How many divisors?

Having established the definition of divisibility, a natural question is How many divisors does a number
have?. We somewhat answered this question last week, but we need to digress a bit to take a look at
the building blocks.
Lets take a look at a number b. Finding the number of divisors of b is the same thing as finding
b
the number of a such that
is an integer, but we dont have very much information about that.
a
Firstly, are there any obvious values of a that work? Well, a = 1 certainly always results in an integer,
as does a = b. Are there necessarily any more?
Problem 2.1. Can a number have exactly 2 divisors? If so, give an example.
Such numbers are called prime numbers, and numbers with more than two divisors are called
composite numbers.
Problem 2.2. Are there any numbers that dont fit either definition?
The first few prime numbers are 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, and so on. The first thing
worth noting about these numbers is that they dont fit any particularly nice pattern (other than the
fact that theyre all prime!). Therefore the next natural question to ask is
Problem 2.3. You are given a number n. How can you (efficiently) tell if its prime?
Solution. To establish that n is prime, we have to make sure that 2 - n, 3 - n, 4 - n, . . . , n 1 - n.
Clearly, for relatively large n, this will take a very very long time. We need a smarter approach.
The first thing we should notice is that several of these checks are redundant. Once we establish
that 2 - n, we know that n is odd (or, of course, n = 2 - but n = 2 is pretty easy to verify!), so we
dont need to waste our time checking that 4 - n, 6 - n, and so on. Similarly, we dont need to bother
checking that 6 - n, 9 - n, 14 - n, 35 - n, and so on. We can make this observation rigorous fairly easily.
Suppose there exists some composite number c such that c | n. But since c is composite, this means it
has more than two divisors, meaning theres some divisor d between 1 and c. If d | c and c | n, then we
established above that this means d | n. Repeating this process means that we only need to focus
on prime divisors. Like we guessed above, we only need to check 2 - n, 3 - n, 5 - n, 7 - n, and so on.

We can streamline this process even further. Suppose n = ab. If a > n and b > n, then

ab = n > n, which obviously isnt possible. So if n is not prime, it has a divisor less than n. That

means we dont need to check every prime up to n, we only need to check the primes up to n! Thats
a significant difference, especially in practice.
While this algorithm still isnt the most efficient, its by far the most practical for human use. Much
more complicated number theory can be used to dramatically speed up the process, and speeding up
this process for computer use remains the subject of heavy research even today. Primes arent said to
be the building blocks of mathematics for nothing!
Problem 2.4. Is 113 prime?

Solution. Because 113 is somewhere between 10 and 11, we only need to check if 113 is divisible
by one of the primes between 1 and 10. Those primes are quickly found to be 2, 3, 5, and 7, so our
algorithm has successfully reduced the number of divisions we have to do from 112 to 4. Anyway, we
can quickly verify that 2 - 113, 3 - 113, 5 - 113, and 7 - 113, so 113 is indeed prime.

December 6, 2014

Example applications and problems

Primes are often referred to as the building blocks of mathematics, and for good reason. One
extremely important result is the Fundamental theorem of Arithmetic, a name that certainly
doesnt overstate its importance!
Theorem 3.1 (Fundamental theorem of Arithmetic). Every integer n can be written uniquely as a
product of primes.
This is actually two statements, of equal importance, rolled into one. The first of these is that
every integer has a prime factorization, or some set of primes that multiply to it. For example,
6 = 2 3, 8 = 2 2 2 = 23 , 2014 = 2 19 53, and so on. The second statement, which is no less
important, is that this factorization is unique. Thus once we find 2014 = 2 19 53, we know that
there is no other combination of primes that multiply to 2014 (of course, 19 2 53 is not different
from 53 2 19 or any of the other permutations).
Though we dont often reference this theorem by name, we tend to use it implicitly throughout
most of number theory. One basic application is that if a = b and p | a, then p | b. When written
like that it may seem obvious, but it also holds when a and b are arbitrary expressions. One common
example of its power is the following demonstration of irrationality, which (according to legend) got
its discoverer thrown off a boat in vengeance.

Problem 3.1. Prove that 2 is irrational.

a
Problem 3.2. Show that b is either irrational or an integer.
There is far more to be said, but for now well dive into a problem. Note that while the work looks
long when written out, the actual process of solving the problem is very quick with a bit of practice.
Problem 3.3. The largest divisor of 2, 014, 000, 000 is itself. What is its fifth largest divisor?
Solution. We can equivalently find its fifth smallest divisor, then divide through by it to get our answer.
Clearly 1 divides 2014000000, as does 2. Does 3 divide 2014000000? Well, before we introduce the
divisibility rule for 3, lets see how we would approach this with more general numbers. Recall that
a | b, c = a | b + c, which in this context means that if we know that 3 does divide something, then
we can subtract it from 2014000000. If the result is divisible by 3, then 2014000000 is also divisible
by 3 (and vice versa). Of course, we can repeat this process as many times as necessary.
One easy number to work with thats divisible by 3 is 1800000000 (since 3 | 18 and 18 | 1800000000).
So 3 divides 2014000000 if and only if 3 divides 214000000. Now we can subtract off 210000000, so
we just need to check if 3 divides 4000000. Continuing down this road, it quickly becomes clear that
3 does not divide 2014000000.
Instead, we can use the far simpler divisibility rule: 3 divides n if and only if 3 divides the sum of
the digits of n. In this case, the sum of the digits of 2014000000 is 7, so since 3 does not divide 7, 3
does not divide 2014000000. Note that this rule also holds for 9.
Anyway, 4 certainly divides 2014000000 (as 4 | 100 and 100 | 2014000000), as does 5 for the same
reason. We dont need to bother checking if 6 divides 2014000000, since we already established that
3 does not divide it. We can quickly, if tediously, determine that 7 doesnt divide it, but as 8 | 1000
and 1000 | 201400000, 8 does divide it. So 8 is the 5th smallest divisor, and our final answer is
2014000000
= 251750000.
8
3

Introductory Number Theory

December 6, 2014

Problem Set
1. Let p, q, and r be three prime numbers that sum up to 62. What the minimum possible value
of pqr?
2. A group of 25 pennies is arranged into three piles such that each pile contains a different prime
number of pennies. What is the greatest possible number of pennies possible in any of the three
piles? (MATHCOUNTS)
3. What is the largest two-digit number whose digits are also prime? (MATHCOUNTS)
4. A three-digit prime number is randomly selected. What is the probability that its digits sum up
5. Find all integers n 1 such that n2 1 is prime.
6. Three positive integers are each greater than 1, have a product of 27000, and are pairwise
relatively prime. What is their sum? (Note: pairwise relatively prime means that no two
numbers share a common prime factor) (AMC 10)
7. How many ordered pairs of positive integers (M, N ) staisfy the equation

M
6
= ? (AMC 10)
6
N

8. A majority of the 30 students in Ms. Deameanors class bought pencils at the school bookstore.
Each of these students bought the same number of pencils, and this number was greater than 1.
The cost of a pencil in cents was greater than the number of pencils each student bought, and
the total cost of all the pencils was \$17.71. What was the cost of a pencil in cents? (AMC 10)
9. Marvin had a birthday on Tuesday, May 27 in the leap year 2008. In what year will his birthday
next fall on a Saturday? (AMC 10)
10. The number 2013 is expressed in the form
2013 =

a1 !a2 ! am !
,
b1 !b2 ! bn !

where a1 a2 am and b1 b2 bn are positive integers and a1 + b1 is as small as

possible. What is |a1 b1 |? (AMC 10)

BCA Math Team

Learning to Count

November 15, 2014

Learning to count

When you hear the word count, you probably think of what you learned as a small child: 1, 2, 3,
.... But, of course, this is only the most basic of counting methods we have. For example, if you were
given a large pile of objects and were asked to count them, youd likely group them in some fashion
to make your job simpler. However, both of these methods become impractical when this pile is very
large, meaning that we need to explore other options.
Lets start with a simple question: suppose there are two people standing next to each other. We
want to give them two pieces of candy, one red and one blue, without regard to fairness (so we could
give both pieces to one person). How many ways is this possible? Well, thats a pretty easy example:
there are four ways. We could give both candies to the first person, both candies to the second person,
the red candy to the first person and the blue candy to the second, or the blue candy to the first
person and the red candy to the second. Great, now we know how to count!
Not so fast. What happens if we now have six pieces of candy, colored red, orange, yellow, green,
blue and purple. Now our listing method isnt particularly practical. We need a more general method.
Lets focus specifically on the red candy. It could go either to the first person or to the second person,
so we have
# of ways to distribute all the candies =
# of ways to distribute the other five candies if the red candy goes to the first person
+ # of ways to distribute the other five candies if the red candy goes to the second person
but since who we give the red candy to doesnt affect how we distribute the other five candies - we
say that these are independent events - the number of ways to distribute the remaining five candies
is the same in both these cases. Thus we can instead write
# of ways to distribute all the candies = 2(# of ways to distribute the other five candies)
This innocuous looking process tells us one of the most important things about counting:
Theorem 1.1. Suppose P and Q are independent events, and suppose there are p ways to achieve P
and q ways to achieve Q. Then the number of ways to achieve P and Q is pq.
In common English, this means that we multiply the number of possibilities for independent events.
The events in the above example were the distribution of each of the candies, each of which have two
possible ways to achieve them. Therefore, the number of ways to achieve them all is 26 = 64 .
Problem 1.1. Suppose any combination of four letters is a word (e.g. four, swag, and xxyy
are all words). How many four-letter words are there?
Problem 1.2. How many four-letter words are there if the first letter must be a vowel (not counting
y), the second letter must be a consonant, and the third letter must be in the first half of the alphabet?
One important application of this is a problem that wouldnt appear, on the surface, to have much
to do with counting at all!
Problem 1.3. How many divisors of 12 are there (i.e. how many positive integers n are there such
12
that
is also an integer)?
n
Problem 1.4. How many divisors of 3600 are there?
1

BCA Math Team

Learning to Count

November 15, 2014

Breaking independence

Weve already taken a look at the number of ways two independent events can occur, but what
happens when the events directly affect each other? For example, how many ways can we distribute
the aforementioned six pieces of candy to six people, if every person has to get exactly one candy?
The answer is not 66 because these events are no longer independent.
So how do we deal with this problem? We can still use our multiplication strategy, but we need
to take into account that not all these events are the same anymore. There are, just as before, six
ways to give out the red candy, but there are only five ways to give out the orange candy after that
(because the person receiving the red candy cannot receive any more candy). Similarly, there are four
ways to give out the yellow candy, and so on. Thus, there are
6 5 4 3 2 1 = 720
ways to distribute all the candy.
Problem 2.1. Suppose we choose to distribute the candy as follows: put the six people in a line, then
give the first person the red candy, the second person the orange candy, and so on. Why does this
count all possible arrangements of the candy, and only all possible arrangments of the candy?
This product, n (n 1) (n 2) . . . 3 2 1, is so important that we give it a special symbol:
Definition 2.1. n!, read n factorial, is equal to n(n 1)(n 2) . . . (3)(2)(1).
Note that 0!, perhaps counterintuitively, is 1. This is because there is only one way to distribute
zero candies to zero people, which is to do absolutely nothing. Also, note that n! counts the number
of ways to arrange n distinguishable objects, by the same argument as we used above. There are n
ways to choose which object should go in front, n 1 ways to choose which of the remaining object
should go next, and so on.
Problem 2.2. How many four-letter words have no two letters the same (so swag counts, but xxyy
does not)?
Sometimes we have to be careful with the order in which we consider the events. For example,
suppose we ask how many two-digit numbers are odd and have no digit repeated. We might do this
problem by noting that there are nine possible ways to decide what the first digit is, but then we would
have an issue figuring out how many possibilities there are for the second digit - since it depends on
whether the first digit is odd or even. If we perform our analysis in the other direction however, we
can easily see that there are five possibilities for the second digit (1, 3, 5, 7, and 9), and there are then
eight remaining possibilities for the first digit (anything between 1 and 9, except for the one we used
for the last digit). Thus there are 5 8 = 40 odd 2-digit numbers.
Problem 2.3. How many four-digit numbers have no digit repeated?
Problem 2.4. How many odd four-digit numbers have no digit repeated?

BCA Math Team

Learning to Count

Permutations and Combinations

Recall that n! counts the number of ways to arrange n objects in a line. This is equivalent to putting
n chairs in a line for n people, and counting the number of ways they could sit. But what if, like most
math competitions, there are an insufficient number of chairs? Suppose, for example, that there are 6
people and only three chairs. How many ways could they sit then?
We can deal with this problem using the same tools we have above. There are six ways for the first
chair to be filled, five ways for the second chair to be filled (since one person has already been seated),
and four ways for the final chair to be filled. Thus, there are 6 5 4 = 120 possible arrangements.
More generally, when there are n people and k chairs, there are n(n 1)(n 2) . . . (n k + 1) possible
n!
arrangements, which can be more concisely written as
(why?). This is known as the number
(n k)!
of permutations of size k from a set of size n, sometimes written as n Pk .
This interpretation of the permutation is not particularly interesting, but this changes when we
look at alternate ways to express it. Suppose, for next year, we need to choose five people to run
math team: a President, a Vice President, a Speaker of the House, a President pro tempore, and a
Secretary of State. If the math team has 100 people next year, how many ways is this possible? Well,
we can look at all these positions as a chair, giving us another way to look at the permutation. Like
before, there are 1 00P5 = 100 99 98 97 96 ways to make the selection.
Finally, the most important interpretation of the permutation is the number of ways to choose k
elements from a set of size n, with respect to order. This is, of course, identical to both interpretations
above, but this is really why we care about it.
Problem 3.1. What is n Pn ? Why does this make sense based on any interpretation above?
Perhaps more interesting is what happens when, like most situations, we dont care about order.
For example, suppose like before we wanted to choose five people to run math team, but they all have
the same title of captain. Why cant we proceed as before? Well, we are overcounting possibilities.
To see why, lets look at the simpler problem of choosing two people from a group of six. If we went
with our naive approach above, there would be 6 5 = 30 such committees. But were counting the
committee Alex, Kelvin and the committee Kelvin, Alex, which we dont want to do because
these committees are the same thing! To correct for this, we need to divide by 2, since each committee
is counted twice.
Going back to our original problem, we now need to find out how many times each committee is
counted. But this is easy, as its equivalent to the number of ways to arrange each committee - which
we already know how to do. There are 5! = 120 ways to arrange five people, so we need to divide our
above count by 120.
Hence the combination can be interpreted as the
number of ways to choose k elements from a set
 
n
n Pk
of size n without regard to order. We write this as
, and it is equivalent to
. More naturally,
k
k!
we can write it as
 
n
n!
=
k
k!(n k)!
  

 
n
n
n
Problem 3.2. Show that
=
. Why does this make sense, given that
measures the
k
nk
k
number of ways to select k elements from a set of n elements?
  
 

n
n1
n1
Problem 3.3. Show that
=
+
. Why does this make sense?
k
k
k1
3

BCA Math Team

Learning to Count

November 15, 2014

Problem Set
1. A test contains five true/false questions. If a student guesses randomly on each of these questions,
what is the probability he gets them all right? (MATHCOUNTS)
2. What is the last digit of 1! + 2! + 3! + . . . + 2014!? (MATHCOUNTS)
3. What is the value of

7!5!
? (JHMMC)
6!2

4. In a round robin tournament, each of six softball teams plays each other team exactly once. How
many softball games are needed? (MATHCOUNTS)
5. A palindrome is a number that reads the same forwards and backwards, such as 20144102. How
many three-digit numbers are palindromes? (MATHCOUNTS)
6. A yogurt shop has four different flavors and six different toppings. If a customer wanted to get
one flavor and two different toppings, how many combinations could she get? (MATHCOUNTS)
7. Twelve lines are drawn in a plane, so that no two lines are parallel and no three lines are
concurrent (i.e. no three lines go through the same point). Every point where two lines intersect
is colored red. How many points are colored red? (AHSME)
8. Alpha, Bravo, Charlie, Delta, and Echo arrange themselves in a line. If Alpha and Bravo must
stand next to each other, how many possible arrangements are there?
9. At the end of a tournament, five chess players have a playoff. The 5th seed plays against the 4th
seed, and the loser receives 5th prize. The winner plays against the 3rd seed in another match,
and the loser receives 4th prize. The winner plays against the 2nd seed in another match, and
the loser receives 3rd prize. The winner plays against the 1st seed in another match, and the
loser receives 2nd prize, while the winner receives first prize. How many different ways can the
playoff finish?
10. A new school has exactly 1000 lockers and exactly 1000 students. On the first day of school, the
first student enters the school and opens all the lockers. The second student then enters and
closes every locker with an even number. The third student will reverse every third locker (if
closed, he will open it, and if open, he will close it). The fourth student will reverse every fourth
locker, and so on, until all 1000 students have entered and reversed the proper lockers. Which
lockers will be open at the end? (MAO)

Introduction

Definition 1.1. A polynomial is an expression of the form

P (x) =

n
X

ai xi = an xn + an1 xn1 + . . . + a1 x + a0

i=0

where x is a variable and n, the degree of the polynomial, is some finite nonnegative integer. Each
of the ai , the coefficients, can be anything in the field we are working with (sometimes integers,
sometimes reals, sometimes even complex numbers), with the caveat that an , the leading coefficient,
is nonzero. Moreover, any r for which P (r) = an rn + an1 rn1 + . . . + a0 = 0 is known as a root of
the polynomial.
For instance, expressions such as P (x) = x+2, P (x) = x2 +17, and P (x) = 2 7x3 +e2 x2 +1337x+2
1
x3 + 2
1 x2
are all examples of polynomials, while P (x) = , P (x) =
,
and
P
(x)
=
are not. The
x
x3
x+1
important thing to keep in mind when working with polynomials is that they behave in very similar
ways to numbers. We can add and subtract polynomials (recall combining like terms), multiply
them, and even divide them. This last property is particularly important. Just as an integer can be
divided by another to give a quotient and remainder (for example, 2014 = 5 402 + 4), we can divide
two polynomials to get a quotient and remainder. More formally,
Theorem 1.1. Given polynomials f (x) and g(x) with g(x) 6= 0, there exist unique polynomials q(x)
and r(x) such that f (x) = q(x)g(x) + r(x) and deg(r) < deg(g). We say g(x) divides f (x), or g(x) is
a factor of f (x), when r(x) = 0.
Corollary 1.1. In this way, we can determine the greatest common divisor of two polynomials by
using the Euclidean algorithm.
Writing out polynomials in this way is very important in a variety of situations. The most pertinent
is when we can choose c such that g(c) = 0 to imply f (c) = r(c). This often gives us a host of useful
information.
Theorem 1.2. The remainder when f (x) is divided by x c is f (c).
Corollary 1.2. If r is a root of f (x), then x r is a factor of f (x). Conversely, if x r is a factor
of f (x), then r is a root of f (x).

Even more identities

Before we move on, lets summarize our findings from last week:
Theorem 1.1. In the following, , , are all any angle, while k, n are any integers.
cos() = cos( + 2k), sin() = sin( + 2k)
cos() = cos( ), sin() = sin( )
cos() = cos(), sin() = sin()




sin +
= cos , sin = cos

2
2
sin2 + cos2 = 1
ei = cos + i sin
sin( ) = sin cos sin cos
cos( ) = cos cos sin sin
(cos + i sin )n = cos(n) + i sin(n)
Though weve already seen enough to do a great numbers of problems, we still need to introduce
a couple more formulae for our toolbox to be complete. Oftentimes we will come across
 situations
 
 
2
4
cos
cos
,
where we have sums or products of trigonometric quantities, for example cos
7
7
7
and we would like to have them as a sum instead. To achieve this, or the reverse, we use the (very
creatively named) product-to-sum identities. More often we want to convert sums into products, so
Theorem 1.2 (Sum-to-Product). For any angles and ,

sin + sin = 2 sin

+
2


cos + cos = 2 cos

cos cos = 2 sin


cos

+
2

+
2


cos

sin

A simple change of variable allows us to do the reverse:

Theorem 1.3 (Product-to-Sum). For any angles and ,
cos cos =

1
(cos( + ) + cos( ))
2

1
(sin( + ) + sin( ))
2
1
sin sin = (cos( + ) cos( ))
2
sin cos =

October 18, 2014

Though we generally like to focus on the sine and cosine functions, sometimes it is helpful to utilize
the other trigonometric functions. Often this is simply to save ourselves some space, but sometimes
it drastically simplifies the situation. While the reciprocal functions (cosecent, secent, and cotangent)
are practically never useful, the tangent function is of almost as much importance as the base ones.
cos
Since tan =
, we can quickly analogue a few of our previous identities:
sin
Theorem 2.1. For any angle and integer k,
tan = tan()
tan( ) = tan
tan = tan( + k)
The sum and difference of tangent is slightly trickier:
Theorem 2.2. For angles and ,
tan( ) =

tan tan
1 tan tan

This is often useful due to being self-contained so to speak, in that the sum/difference of tangent
is in terms of tangent (unlike sine and cosine which are interdependent).

yrtemonogirT

Though the sine, cosine, and tangent functions all have no inverses, we can change this if we restrict
their domains. Before we were using R [1, 1] for sine and cosine, but we can just as easily focus

only on [ , ] [1, 1] for sine and [0, ] [1, 1] for cosine. This is because, using all of our
2 2
formulae above, we can say that

Theorem 3.1. For any angle , there exist angles [ , ] and [0, ] such that
2 2
sin = sin
and
cos = cos
In fact, = +

like we noted before.

2

Now these functions are one-to-one, so we can define their inverse functions:
Definition 3.1. For some x [1, 1] and angle in the functions respective ranges
sin1 x = arcsin x = sin = x
cos1 x = arccos x = cos = x
tan1 x = arctan x = tan = x

October 18, 2014

Example Problems

Last week we tackled some early-level AIME problems, as well as a couple of more difficult ones. Now
were more focused on the mid-range problems. Lets start with one from the problem set last week:
Problem 4.1. Suppose that sec x + tan x =
terms. Find m + n.

22
m
m
and that csc x + cot x = , where
is in lowest
7
n
n

Solution. Theres not an obvious path to victory here, so lets start off by rewriting things in terms
sin x + 1
22
cos x + 1
of sine and cosine. We are given that
=
, and want to find
. Still doesnt seem
cos x
7
sin x
to help too much. Lets try adding these two equations:
sin x + 1 cos x + 1
sin2 x + sin x + cos x + cos2 x
+
=
cos x
sin x
cos x sin x
=

1 + sin x + cos x
sin x cos x

Now were stuck again, but we should notice here that 1+sin x+cos x = (sin x+1)(cos x+1)sin x cos x.
(1 + sin x)(1 + cos x)
1, and hence
Therefore, this fraction is equal to
sin x cos x
22 m
22 m
+
=

1
7
n
7 n
=

29
15 m
m
29
=

=
= .
7
7 n
n
15

Problem 4.2. The domain of the function f (x) = arcsin(logm (nx)) is a closed interval of length
1
, where m and n are positive integers and m > 1. Find the remainder when the smallest possible
2013
sum m + n is divided by 1000.
Solution. This is a very easy problem for mid-level AIME, despite being placed at #8. All that we
need to do is to keep our heads and not get flustered by the notation. We know that the domain of
arcsin is [1, 1] from before, and so
1 logm (nx) 1
1
nx m
m
m
1
=
x
mn
n


1 m
m
1
1
Therefore this closed interval is
,
, and so

=
. The rest is easy - we get
mn n
n
mn
2013
2013(m2 1) = mn, so we want to minimize m. That gives us m = 3, hence n = 5368, and the answer
=

is 371 .

October 18, 2014

Problem Set
1. Determine the value of cos 1 + cos 2 + . . . + cos 358 + cos 359 .
2. For each integer n > 1, let F (n) be the number of solutions to the equation sin x = sin (nx) on
2007
X
the interval [0, ]. What is
F (n)? (AMC 12 #24)
n=2

cos x
1
sin 2x cos 2x
sin x
= 3 and
= . The value of
+
3. Let x and y be real numbers such that
sin y
cos y
2
sin 2y
cos 2y
p
can be expressed in the form where p and q are relatively prime positive integers. Find p + q.
q
(AIME #9)

3
4. Suppose x is in the interval [0, ] and log24 sin x (24 cos x) = . Find 24 cot2 x. (AIME #9)
2
2
5. What is the sum of all positive real solutions x to the equation



2014 2
= cos(4x) 1?
2 cos(2x) cos(2x) cos
x
(AMC 12 #25)
6. Find the positive integer n such that
arctan

1
1
1
1

3
4
5
n
4

(AIME #8)
7. Let a =

. Find the smallest positive integer n such that

2008
2[cos a sin a + cos(4a) sin(2a) + cos(9a) sin(3a) + . . . + cos(n2 a) sin(na)]

is an integer. (AIME #8)

8. While finding the sine of a certain angle, an absent-minded professor failed to notice that his
calculator was not in the correct angular mode. He was lucky to get the right answer. The two
least positive real values of x for which the sine of x degrees is the same as the sine of x radians
p
m
are
and
, where m, n, p and q are positive integers. Find m + n + p + q. (AIME
n
q+
#10)
9. For how many positive integers n less than or equal to 1000 is (sin t + i cos t)n = sin nt + i cos nt
true for all real t? (AIME #9)
10. Find the sum of the values of x such that cos3 3x+cos3 5x = 8 cos3 4x cos3 x, where x is measured
in degrees and 100 < x < 200.

BCA Math Team

Modular Arithmetic I

December 6, 2014

The Basics

Definition 1.1. a and b are congruent modulo c if and only if a and b leave the same remainder upon
division by c.
Definition 1.2. a and b are congruent modulo c if and only if c | a b.
Both of the (equivalent) statements above give the fundamental definition of modular arithmetic, which is extremely important in all areas of number theory. For now, we will only concern
ourselves with integers (so, unless otherwise specified, all variables are integers). Modular arithmetic
satisfies a few obvious, but important properties:
If a b (mod c), then b a (mod c).
If a1 b1 (mod c) and a2 b2 (mod c), then a1 + a2 b1 + b2 (mod c)
If a1 b1 (mod c) and a2 b2 (mod c), then a1 a2 b1 b2 (mod c)
These, of course, easily extend to more than two variables via induction. One special case of the latter
is also worth specifically noting:
Theorem 1.1. If a b (mod c), then an bn (mod c)
Unlike addition (and, therefore, subtraction) and multiplication, division doesnt work quite as
nicely in modular arithmetic. In particular, if ac bc (mod d), it does not necessarily follow that
a b (mod d). This isnt too difficult to see with a simple example: 6 2 (mod 4), but 3 6 1
(mod 4). Fortunately, this isnt too difficult to correct by simply using the definition. We know that
d
d | ac bc = c(a b), which tells us only that
| a b. Rewriting this in terms of modular
gcd(c, d)
arithmetic, we get
Theorem 1.2. If ac bc (mod d), then
a b (mod

d
)
gcd(c, d)

One common usage of modular arithmetic is to take an entire equation over a convenient modulus,
thus establishing conditions on the search space. Often the point of this is to establish a contradiction,
therefore demonstrating that the equation has no solutions, but it can be much simpler than that.
For example,
Problem 1.1 (2012 AIME II Problem 1). Find the number of ordered pairs of positive integer solutions
(m, n) to the equation 20m + 12n = 2012.
Solution. Dividing the equation by 4 gives 5m + 3n = 503. Taking this equation modulo 3, we get
5m + 3n 503

(mod 3)

= 2m 2

(mod 3)

= m 1

(mod 3)

It is clear that any m 1 (mod 3) results in an integer solution for n, but as we are restricting
ourselves to positive integer solutions, we have 1 m 100, of which 034 are equivalent to 1
modulo 3.
1

BCA Math Team

Modular Arithmetic I

December 6, 2014

Solving Modular Systems

Oftentimes well be presented with a series of modular congruences, which we would like to condense
into a single statement. Before we can even approach this problem, we need to introduce one more
property of modular arithmetic:
Theorem 2.1. If a b (mod c) and a b (mod d), then a b (mod lcm(c, d)).
So what exactly is a system of congruences? In its simplest form, we are given something like
N a1

(mod b1 )

N a2

(mod b2 )
...

N ak

(mod bk )

and we would like to condense this into a single statement. We assume, of course, that these congruences are not contradictory, e.g. that we are not given something like N 2 (mod 4) and N 1
(mod 2). To simplify matters well assume that all the bi are pairwise relatively prime.
The first natural question to ask is Is this always possible?. A relatively simple non-constructive
proof answers this question in the affirmative, known as the Chinese Remainder Theorem, which
establishes that there exists a unique r such that N r (mod b1 b2 . . . bk ) is the solution to the above
congruences. Unfortunately, being non-constructive (though there are constructive approaches, they
are more useful for computers than humans), it doesnt help us much in the practical sense. So the
next natural question to ask is how hard is it?, and this is a significantly more difficult question to
In practice, when the numbers are relatively small, the simplest method is to simply list out the
sets A and B of numbers equivalent to a1 (mod b1 ) and a2 (mod b2 ) respectively, until we find some
number r in both sets. We can then immediately conclude that the simultaneous solution to the
congruences is N r (mod gcd(b1 , b2 )). Of course, this extends easily to more than two congruences.
Well take, as an easy example of several different methods, the following problem:
Problem 2.1. Suppose N 2 (mod 3), N 3 (mod 4), and N 1 (mod 5). Then N k
(mod 60). Find k.
Solution. The first, most obvious method is to simply list out numbers that satisfy the congruences:
N 2

(mod 3) N {. . . , 2, 5, 8, 11, 14, 17, 20, 23, 26, 29, 32, 35, 38, 41, 44, 47, 50, 53, 56, 59, . . .}
N 3

(mod 4) N {. . . , 3, 7, 11, 15, 19, 23, 27, 31, 35, 39, 43, 47, 51, 55, 59, . . .}

N 1

(mod 5) N {. . . , 1, 6, 11, 16, 21, 26, 31, 36, 41, 46, 51, 56, . . .}

Note how we can stop our search once we hit 60, as lcm(3, 4, 5) = 60. A quick scan reveals that 11 is
in all three sets, hence N 11 (mod 60) is the solution set to the three congruences.

BCA Math Team

Modular Arithmetic I

December 6, 2014

An Algebraic Method

Unsurprisingly, the brute force approach outlined in the previous section does not extend well to large
numbers. Instead, when the computations become infeasible, we need a more general approach. To
do this, well introduce a third definition of modular congruences:
Definition 3.1.
ar

(mod b) q 3 a = bq + r

Using this, we can solve the previous problem in a different manner:

Problem 3.1. Suppose N 2 (mod 3), N 3 (mod 4), and N 1 (mod 5). Then N k
(mod 60). Find k.
Solution. We know that there exist a, b, c such that N = 3a + 2 = 4b + 3 = 5c + 1. Since
3a + 2 = 4b + 3 = 3a + 2 4b + 3 3
= 3a 1

(mod 4) = a 3

(mod 4)

(mod 4)

we can write a = 4x + 3 for some x. Then N = 3(4x + 3) + 2 = 12x + 11. Repeating this process, we
get
N = 12x+11 = 5c+1 = 12x+11 5c+1

(mod 5) = 12x 0

(mod 5) = x 0

(mod 5)

hence we can write x = 5y for some y, whence N = 12(5y) + 11 = 60y + 11. Rewriting this in modular
notation, we have N 11 (mod 60).
The only real computation involved here is finding the modular inverse, or a b such that ab 1
(mod c) for given a, c. Though this can certainly be difficult for large a, c, in general it is highly
preferable to listing out tons of large numbers.
Sometimes we can cut down on our work significantly through a bit of clever manipulation:
Problem 3.2 (PUMaC). Find the smallest positive integer x such that
x is 1 more than a multiple of 3,
x is 3 more than a multiple of 5,
x is 5 more than a multiple of 7,
x is 9 more than a multiple of 11, and
x is 2 more than a multiple of 13.
Solution. Obviously we dont want to go through the motions for 5 different equations, but one
quick stab eliminates most of them immediately. We notice the symmetry amongst the first four
equations - they are all of the form x n (mod n + 2), which we can take advantage of by rewriting
them in the form x 2 (mod n + 2). Therefore x 2 (mod 3, 5, 7, 11), and hence x 2
(mod 3 5 7 11 = 1155).
Now we fall back on our algebraic method. We know there exists some k such that x = 1155k2 2
(mod 13), hence 11k 4 (mod 13). All we have to do now is find the smallest positive k satisfying
this, which is 11, making our answer 1155 11 2 = 12703 .
3

BCA Math Team

Modular Arithmetic I

December 6, 2014

Problem Set
1. Prove the divisibility rule for 9. More rigorously, define S(n) to be the sum of the digits of n.
Prove that 9 | n 9 | S(n).
2. Let S be a subset of {1, 2, 3, . . . , 30} with the property that no pair of distinct elements in S has
a sum divisible by 5. What is the largest possible size of S?
3. Two farmers agree that pigs are worth \$300 and that goats are worth \$210. When one farmer
owes the other money, he pays the debt in pigs or goats, with change received in the form of
goats or pigs as necessary. (For example, a \$390 debt could be paid with two pigs, with one goat
received in change.) What is the amount of the smallest positive debt that can be resolved in
this way?
4. In base 10, the number 2013 ends in the digit 3. In base 9, on the other hand, the same number
is written as (2676)9 and ends in the digit 6. For how many positive integers b does the base-b
representation of 2013 end in the digit 3?
5. Albert has a very large bag of candies and he wants to share all of it with his friends. At first, he
splits the candies evenly amongst his 20 friends and himself and he finds that there are five left
over. Ante arrives, and they redistribute the candies evenly again. This time, there are three
left over. If the bag contains over 500 candies, what is the fewest number of candies the bag can
contain?
6. You are given that
17! = 355687ab8096000
for some digits a and b. Find the two-digit number ab.
7. Let x and y be integers. Prove that 2x + 3y is divisible by 17 if and only if 9x + 5y is divisible
by 17.
8. For each positive integer k, let Sk denote the increasing arithmetic sequence of numbers whose
first term is 1 and whose common difference is k. For example, S3 is the sequence 1, 4, 7, 10, . . ..
For how many values of k does Sk contain the term 2005?
9. Ms. Maths kindergarten class has 16 registered students. The classroom has a very large
number, N , of play blocks which satisfies the conditions:
(a) If 16, 15, or 14 students are present, then in each case all the blocks can be distributed in
equal numbers to each student, and (b) There are three integers 0 < x < y < z < 14 such that
when x, y, or z students are present and the blocks are distributed in equal numbers to each
student, there are exactly three blocks left over.
Find the sum of the distinct prime divisors of the least possible value of N satisfying the above
conditions.

10. Let N be a positive integer relatively prime to 10. Show that some multiple of N consists only
of 1s. For example, when N = 21, N | 111111111111.

BCA Math Team

Modular Arithmetic II

December 20, 2014

Power residues

Because a b (mod n) = ak bk (mod n), when we see an expression like xy we know that
the only values it takes, working over modulo n, are the ones attained when x {0, 1, 2, . . . , n 1}.
The most common form is this phenomenon are quadratic residues, which occur when y = 2. More
specifically,
Definition 1.1. b is a quadratic residue modulo n if and only if there exists an a {0, 1, 2, . . . , n 1}
such that a2 b (mod n)
For example, since 02 0 (mod 3), 12 1 (mod 3), and 22 1 (mod 3), the quadratic residues
modulo 3 are 0 and 1. We usually utilize the properties of quadratic residues to solve Diophantine
equations involving powers, most often to prove that no solutions exist. For example, one simple
example would be
Problem 1.1. Find all (x, y) such that x2 + 3y 2 = 42133742.
Solution. Consider the equation modulo 3. Then we have x2 2 (mod 3). But, as we saw above, this
is impossible, and so there are no solutions to the equation.
Sometimes we use moduli not to show that there are no solutions, but to show there are no large
solutions, leaving us only a few small cases. In other problems, we use moduli to restrict variables
to certain congruences, eventually cumulating in a family of solutions. We often have to combine
modular information with our other major number theoretic technique, bounding, as in the below
problem.
Problem 1.2. Find the sum of all possible sums a + b where a and b are nonnegative integers such
that 4a + 2b + 5 is a perfect square. (PUMaC)
Solution. We are, equivalently, trying to solve the Diophantine 4a + 2b + 5 = x2 . When working with
squares, we usually first want to take the equation modulo 3 and/or modulo 4, so we do that here.
When we take the equation modulo 3, we get
x2 (1)2 + (1)b + 5

(mod 3)

which tells us that b is even (otherwise x2 5 2 (mod 3), which we already established is impossible). Taking the equation modulo 4 doesnt give us much information, as all we get is x2 5 1
(mod 4) which tells us that x is odd. We do get, however, that a, b > 0, as otherwise x2 2, 3 (mod 4)
which is impossible as before. Anyway, seeing that 5 there next to powers of 4 should suggest taking
the equation modulo some power of 2 (since this will force a, b to be small). As 4 is unhelpful, lets
try 8. If a > 1 and b > 2, then 4a and 2b are both multiples of 8, so we would get x2 5 (mod 8).
We can easily check that this is impossible, as x2 0, 1, 4 (mod 8), so either a = 1 or b = 1, 2.
Now we just need to check a couple of small cases. If a = 1 then we have x2 = 2b + 9. Taking this
equation modulo 3 gives us that b is even, so let b = 2c. Then x2 = 22c + 9, but (2c )2 < x2 < (2c + 1)2
when c > 2. So we only have to check b = 2, b = 4, which leads to x = 5, a = 1, b = 4 as a solution.
Finally, if b = 1 then 4a + 7 3 (mod 4) is not a perfect square, so we just need to check b = 2.
We have x2 = 4a + 9, but this is almost identical to the above case. We get a 2, so we just need
to check a = 1, 2, which leads to the solution x = 5, a = 2, b = 2. The possible sums for a + b are
1 + 4 = 5 and 2 + 2 = 4, so the answer is 5 + 4 = 9.
1

BCA Math Team

Modular Arithmetic II

December 20, 2014

Bounding

Though bounding is often vilified, for good reason, it is actually one of the most important tools
we have in our arsenal. One basic example, as we saw in the previous problem, is bounding some
expression between two consecutive perfect squares - implying it cannot itself be a perfect square.
Problem 2.1. Find all pairs of nonnegative integers (x, y) such that x2 + y + 1 and y 2 + 4x + 3 are
both perfect squares.
Solution. Suppose x y. Then y 2 + 4x + 3 y 2 + 4y + 3 < y 2 + 4y + 4 = (y + 2)2 . Furthermore,
y 2 + 4x + 3 y 2 + 3 > y 2 . Thus, y 2 + 4x + 3 = (y + 1)2 = y 2 + 2y + 1 = y = 2x + 1. Then
x2 + y + 1 = x2 + 2x + 2 = (x + 1)2 + 1, possible only when x = 1, contradiction.
So x > y. Then x2 + y + 1 < x2 + x + 1 < x2 + 2x + 1 = (x + 1)2 and x2 + y + 1 > x2 , so x2 + y + 1
cannot be a perfect square.
Hence there are no such pairs (x, y).
Oftentimes we simply use bounding as an intermediate step to reduce the number of cases we
have to check. In practice we do this quite often without really thinking about it (hm, x is probably
10-ish), but we can usually make that argument somewhat more rigorous. For example,
Problem 2.2. Find all integer pairs (x, y) such that x3 y 3 = xy + 61.
Solution. We have (x y)(x2 + xy + y 2 ) = xy + 61. If y > x, then x y < 0 = x2 + xy + y 2
xy 61 = (x + y)2 61, absurd, so x > y (of course, x = y is impossible). We thus have
x2 + xy + y 2 xy + 61 = x2 + y 2 61, drastically reducing our search space. We now only need
to check 6 x 7, which is easily (if slowly) done. We can also slightly improve on this by noting
x3 61 = y 3 + xy = y(y 2 + x) y(y 2 + x2 ) 61y, which reduces our search to 5 x 6.
If x = 6, then 216 y 3 = 6y + 61 = 155 = y 3 + 6y = y = 5, hence (6, 5) is a solution.
If x = 5, then 125 y 3 = 5y + 61 = 64 = y 3 + 5y, which has no solution.
If x = 4, then 64 y 3 = 4y + 61 = 3 = y 3 + 4y, which has no solution.
If x = 3, then 27 y 3 = 3y + 61 = 34 = y 3 + 3y, which has no solution.
...
If x = 3, then 27 y 3 = 3y + 61 = 88 = y 3 3y, which has no solution.
If x = 4, then 64 y 3 = 4y + 61 = 125 = y 3 4y, which has no solution.
If x = 5, then 125 y 3 = 5y + 61 = 186 = y 3 5y = y = 6, hence (5, 6) is a
solution.
After all that, our solutions are (6, 5) and (5, 6). While this may look like a lot of work on paper,
under contest conditions this only takes a couple of minutes - well within the amount of time it shoud
take. Yes, this is heavily computational and doesnt require a lot of insight, but contests will have

BCA Math Team

Modular Arithmetic II

December 20, 2014

Problem Set
1. How many integers from 1 to 1000 (inclusive) can not be expressed as the difference of two
integer squares? (AIME)
2. How many ways can 22012 be expressed as the sum of four (not necessarily distinct) positive
squares? (PUMaC)
3. Positive integers x, y, z 100 satisfy
1099x + 901y + 1110z = 59800
109x + 991y + 101z = 44556
Compute 10000x + 100y + z. (OMO)
4. Find all positive integers x such that x2 + 3x is a perfect square.
5. Find all pairs of integers (x, y) such that x2 + 3y and y 2 + 3x are both perfect squares.
6. Let n be a positive integer. If the tens digit of n2 is 7, what is the units digit of n2 ? (Canada)
7. Find all positive integers n such that 2n + 12n + 2011n is a perfect square. (USAJMO)
n2 + 1
8. Determine all positive integers n for which 2
is an integer. Here [r] denotes the greatest
[ n] + 2
integer less than or equal to r. (APMO)