Junior/Intermediate Number Theory Tips

Junior/Intermediate Number Theory Tips

(Last updated 27th July 2013)

Key Terms:

·  Coprime/Relatively Prime: When two numbers don’t share any common factors, i.e. their Greatest Common Divisor is 1.

·  Integer: A whole number.

·  Positive Integer: Does not include 0. i.e. 1 or more.

·  Prime: Note that 1 is NOT prime!

·  Fundamental Law of Arithmetic: Every integer can be expressed as a product of prime factors in one way only. E.g. 12 can only be expressed as a product of primes as 22×3.

·  a|b means that a divides b. e.g. 2|8.

Divisibility Rules:

Divisible By: / Properties
2 / Last digit even
3 / Digits add up to multiple of 3
4 / Last two digits a multiple of 4
5 / Last digit 0 or 5
6 / Divisible by 2 and 3 (so has properties of each)
7 / We could subtract twice the units digit from the remaining digits and keep applying. If the result is a multiple of 7 the original number is a multiple of 7:
e.g. 11529→1152-18=1134→113-8=105→10-10=0
0 is a multiple of 7 so 11529 is.
However, since we need to apply as many steps as there are digits, the trick is only really useful to mentally verify that 3 or 4 digit numbers are divisible by 7 (i.e. useful for the JMC/IMC, but not so useful elsewhere).
8 / Last three digits multiple of 8
9 / Digits add up to multiple of 9
10 / Last digit 0
11 / Add up every other digit and subtract remaining digits. Result is a multiple of 11.
e.g. 7192427→7+9+4+7-1+2+2=22
12 / Divisible by 3 and 4 (so has properties of each).

For divisibility by a larger number, we have the divisibility properties of all this number’s factors. E.g. If divisible by 24, then it must also be divisible by 3 and 8, so the digits add up to a multiple of 3, and the last three digits must be divisible by 8.

Oddness/Evenness

·  odd+odd=even, even+even=even, odd+even=odd
odd×odd=odd (and thus an odd number to any positive integer power is odd)
odd×even=even

·  Spotting when expressions/numbers are odd are even has a variety of uses:

o  We might want to show we have a contradiction in an equation, if we say show the LHS is even and the RHS is odd.

o  It helps us constraint variables. E.g. If 4x+5y=2000, then because the RHS is even, 4x is even when x>0 and 5y is always odd, then 4x would have to be odd and thus x=0.

o  If we knew a variable n was odd, we could replace it with 2k+1 for some integer k and hopefully constrain values of variables further or prove some assertion.

Using Algebra

·  If the digits of a 3-digit number are “abc”, then the value of the number is 100a+10b+c. This might allow us to do further manipulation.

·  Note also that 1≤a≤9 and 0≤b≤9 and 0≤c≤9. In some questions we might have to ‘try out’ possible values for the digits to see if they work for a particular problem. But we’ll often find we only have limited possibilities that need testing.

·  An even number can be represented as 2k where k is any integer. Similarly an odd number can be represented as 2k+1. Similarly, we could represent a square number using k2.

·  For questions where you’re asked to find integer values for variables so that some expression is also an integer, just create a new integer variable.
e.g. “Find the form of all integers n such that 2n+1 is also an integer”, then a good start would be to say 2n+1=k for some integer k, and then 2n+1=k2. Now we have a Diophantine Equation (see below).
Using our ‘oddness/evenness’ tip above, we can see the LHS is odd, so the RHS must be odd. If k2 is odd, since odd×odd=odd, then k must be odd. So we could replace it with 2m+1 where m is an integer. This gives 2n+1=2m+12=4m2+4m+1, thus n=2mm+1. Thus n is twice the product of any two consecutive numbers.

Remainders and Modular Arithmetic

·  If x divided by y gives a remainder of z, then x-z must be divisible by y.
e.g. If 44 divided by 10 gives a remainder of 4, then clearly 44-4=40 is divisible by 10.

·  If 17 and 7 give the same remainder when divided by 5, we can write 17≡7≡2 mod 5. The ≡ symbol means ‘congruent to’. It means that 7 is equivalent to 2 is ‘modulo-5 arithmetic’. In modular arithmetic, numbers have the same value if their remainders are the same. So far example, the bearings 10° and 370° are equivalent (in modulo-360 arithmetic), and we can say that 10≡370 mod 360.

·  You don’t need to know modular arithmetic for JMO/IMO, it’ll become more useful in the Senior version. However, it can be incredibly useful for number theory problems.

·  Laws of modular arithmetic:

o  If a≡b mod c, then ka≡kb mod c. e.g. We know that 6 and 11 have the same remainder when divided by 5, i.e. 6≡11 mod 5. We could scale by 3 for example, so 18 and 33 must have the same remainder when divided by 5.

o  If a=b mod c then ak=bk mod c.
Suppose we wanted to know the last digit of 7100. Then working in modulo-10 arithmetic would give us the units digit (i.e. finding the remainder when we divide by 10). Now 72≡9 mod 10 because 49 gives a remainder of 9 when divided by 10. Also, 73≡3 mod 10 and 74≡1 mod 10 .
At this point, we could use the above law. 74k≡1k≡1 (mod 10),
so 74k≡1 (mod 10). We’ve found the 7 to the power of any multiple of 4 gives a remainder of 1 when divided by 10. Since 100 is a multiple of 4, the units digit of 7100 is 1. This trick is useful whenever we have a remainder of 1, because 1 to any power is still 1.

Using Prime Factorisations

Finding the prime factorisation of a number often helps:

·  A number is square of all the powers/indices in the prime factorisation are even. e.g. 24×36 is a square number, because 22×332=22×33×22×33=24×36. Similarly, a number is a cube if the indices are multiples of 3, and so on.
We could then easily work the smallest multiple of a given number that will be cube say. If 96=25×3, then be multiplying by 2×32=18 we’d have a cube.

·  We can work out the number of factors of a number. Say we have 600=23×3×52. Any factor of 600 will be composed of up to three 2s, up to one 3, and up to two 5s, multiplied together. That’s 4 possibilities for the number of twos used in a factor, 2 possibilities for the number of threes and 3 for the number of fives. That’s 4×2×3=24 factors.
Sometimes you might have to think about this backwards: if a number has a certain number of factors, what number could it be?

·  Note that we get a 0 on the end of a number each time we have a factor of 10. That’s equivalent to each time we have a prime factor pair of 2 and 5. We can easily determine the number 0s therefore by looking at the prime factorisation and taking the minimum power out of the 2 and the 5.

Diophantine Equations

These are just equations where you want to find integer solutions for the variables.

Often the key to these questions is getting your equation in the form of a product of expressions being equal to some integer value. e.g. If we wanted to find positive integer solutions to a(b+1)=12, then by considering the factor pairs of 12 and what a and b+1 could therefore be, we get a,b=1,11,2,5,3,3,4,2,(6,1).

The challenge is often getting your equation in this form:

·  Suppose we had ab-a-b=9. If we had some factorisation, and expanding it gave us the terms ab, -a and –b, then what could that factorisation be? a-1(b-1) sounds like it might work. We find that a-1b-1=ab-a-b+1.
Therefore ab-a-b=a-1b-1-1=9, and thus a-1b-1=10. We’ve successfully got our equation in the form we have a product of expressions, so can now just consider the factor pairs of 10.

·  Similarly, suppose we had 1x+2y=319. Then multiplying through by 19xy so that we don’t have to deal with fractions, we get 19y+38x=3xy. So 3xy-38x-19y=0.
The trick here is to multiply through by the coefficient of the product of the variables, i.e. 3.
Then 9xy-3×38x-3×19y=0
Then notice that 3x-193y-38=9xy-38x-19y+(2×192).
Thus 3x-193y-38=2×192. Because we have the prime factorisation of the RHS, we can quickly obtain the factor pairs (e.g. 19×38).

·  Sometimes we can use the difference of two squares to factorise.
Suppose we want to find integer solutions for a2+200=b2.
Then 200=b2-a2=b+a(b-a). By considering factor pairs of 200, we get a,b=49,51, (23,27) and so on.

·  One final common way to factorise is to complete the square. Suppose we were asked to find the integer values of n for which n2+20n+11 is a perfect square.
n2+20n+11=k2 for some integer k.
Completing the square: n+102-100+11=k2
n+102-k2=89
n+10+kn+10-k=89
And again, we’ve successfully produced a product of expressions. Conveniently, 89 is prime, so n+k+10=89 and n-k+10=1.

·  Don’t forget that the factor pair could be negative! e.g. If we wanted positive integer solutions for a-7b-5=12, then since -3×-4=12, it could be that a-7=-3 and b-5=-4, giving a,b=(4,1). You’ll lose marks if you forget these solutions.

Linear Diophantine Equations

These are equations of the form ax+by=c where a, b, c are constants. It’s called ‘linear’ because it’s the equation of a straight line.

Suppose we had 4x+3y=31, and x and y have to be positive integers. We could try values for one variable and see if they work for the other. e.g. When x=1, we find y=9. When x=2, we have 3y=23, which has no integer solution. In fact we’ll find that each time we increase x by 3 (starting at our first solution of x=1), we’ll have another solution, because 4x will increase by a multiple of 3 (i.e. 12), which can be ‘absorbed’ by the 3y term which will decrease. We know the maximum x can be is 314 rounded down, which is 7.

If the lone constant is a multiple of one of the numbers in front of (i.e. the ‘coefficients’ of) the x or y, we can apply a clever trick to quicken our search!

e.g. Suppose that 4x+13y=130 and we’re again looking for positive integer solutions. We can rewrite this as:
4x=130-13y=13(10-y)

We can immediately see that y is at most 9, otherwise the RHS will be 0 or negative, and so x wouldn’t be positive on the LHS. If we think about factors on each side, the LHS is divisible by 4. On the RHS, this factor of 4 certainly doesn’t appear in the 13, so 10-y must be divisible by 4. This means that y must be 2 or 6. We can then easily find x for each of these.

The Factorial Function

n!=n×n-1×n-2×…×2×1. For example 4!=4×3×2×1=24. We would say this as “4 factorial”.

If we wanted the number of 0s at the end of 100!, then recall we get a 0 at the end each time we have a prime factor pair of 2 and 5. There will be more 2s then 5s in the prime factorisation of 100!, so count the number of 5s. In 100×99×…, we’ll have a factor of 5 for each multiple of 5 in the product. There’s 20 of these. But we’ll get an additional 5 for each multiple of 25, because 25=5×5, i.e. contributing two 5s rather than 1. There’s 4 multiples of 25 up to 100. Thus we have 524 in the prime factorisation of 100! and thus 24 zeros at the end.

Miscellaneous Tips

·  If you have consecutive numbers or numbers which are evenly spaced, represent either the middle number or first number as say n. e.g. If you have 3 consecutive numbers, we can represent these as n-1, n and n+1. This tends to make the algebra simpler (say if we added or multiplied these expressions) than if we were to use n, n+1 and n+2.

·  Every 3 numbers is divisible by 3. So for example nn+1(n+2) must be divisible by 3 because one of n, n+1 and n+2 must be divisible by 3. Similarly every 4th number is divisible by 4 and so on.

·  Suppose you’re trying to find an integer that makes some fractional expression an integer. e.g. Find an integer n such that n2-4n-1 is also an integer. There’s two ways to do this. If you happen to know algebraic long division, then use that! But presuming you don’t notice that if we had n2-1n-1, we’d have an integer because n2-1=n+1(n-1), which is divisible by n-1.
n2-4n-1=n2-1-3n-1=n2-1n-1-3n-1=n+1-3n-1
This whole expression is an integer when n-1 divides 3. If say n was positive, then this would only work when n=4.

·  A squared number is always positive. Suppose we had a2-ab=b where a and b are positive integers. Then since the RHS must be positive, ab<a2. Dividing by a we have b<a.

·  Sometimes we can use the quadratic formula. Recall that when ax2+bx+c=0, then the solutions for x are x=-b±b2-4ac2a.
Above, we had a2-ab=b. Putting this in a quadratic form, where the ‘x' here is instead a, we have a2-ba-b=0, so:
a=b±1+4b2
Thus for a to be an integer, 1+4b is an integer. We could then use the approach we saw on Page 2.

Theorems in Number Theory:

  1. Euclid’s First Theorem: If for integers a and b and a prime p, we have that p|ab, then either p|a or p|b.
  2. Euclid’s Second Theorem: There are an infinite number of prime numbers.
    Proof by contradiction: Suppose there were a finite number of prime numbers, p1, p2, ... pn. Then consider p1p2…pn+1. This can’t be divisible by any of the primes because the remainder will always be 1. Thus either the new number is prime, or its prime factorisation consists only of new prime numbers. Hence we can always discover new primes given a finite list.
  3. Fermat’s Last Theorem: If an+bn=cn where a, b, c are positive integers, then the equation cannot be satisfied when n>2.
    If n=2, then we’d have a2+b2=c2, for which there’s infinitely many solutions, e.g. 32+42=52 (these are known as Pythagorean Triples, because the 3, 4, 5 can be the lengths of a right-angled triangle, satisfying Pythagoras’ Theorem). However, the sum of two cubes can never be a cube, and so on.
    This actually has some practical use! If somehow we managed to factorise an equation to yield a+33+c-a3=3a+b3 (where a,b,c are integers), then because by Fermat’s Last Theorem, there can’t be any positive integer values for a+3 and c-a and 3a+b, and so we only have a solution when 03+03=03, i.e a+3=0, c-a=0 and 3a+b=0. This gives us the solution a=-3, b=9, c=-3.
  4. Fermat’s Little Theorem: If a is an integer and p is prime, then ap-1≡1 (mod p). Equivalently, ap≡p mod p
    For example, suppose we had 1512. Then we know that the remainder will be 1 when we divide by 13. Similarly, we could say that 1512-1 is divisible by 13, or that 1513-15 is divisible by 13.
  5. Wilson’s Theorem: A number n is a prime number if and only if n-1!≡-1 (mod n). For example, take 7. 7-1!=720. When we divide 720 by 7, we get a remainder of 6. This is the same as -1 and modulo-7 arithmetic (because we can keep adding or subtracting 7 in modulo-7 arithmetic and the number will be equivalent, thus a remainder of -1 can be thought of as one less than a multiple of 7). Thus 7 must be a prime number.

And unsolved ones: