Transcript Slide 1

Number Theory
• Factors & Divisibility
• LCM and GCF
• BASE number
• Modular Arithmetic
• Even & Odd Numbers
1
Divisibility Rules
• A number is divisible by 2n if and only if the n
last digits of the number are divisible by 2n.
• A number is divisible by 3 or 9 if and only if the
sum of its digits is divisible by 3 or 9.
• A number is divisible by 5n if and only if the last
n digits are divisible by that power of 5n.
• A number is divisible by 11 if and only if the
alternating sum of the digits is divisible by 11.
2
Example
Which of the following are factors of 123456780?
2, 3, 4,,5,6,8,9,10
Sum of digits = 6+9+6+15=36
multiple of 3 & 9
Ends with 10  multiple of 5 & 10
Last two digits dividable by 4 (22)
multiple of 4
Answer: 2, 3, 4, 5, 6=2x3, 9, 10
3
Example
What is the smallest 5-digit number that is divisible
by both 8 and 9?
Consider a five digit number ABCDE
The smallest will be A = 1, and we
prefer the rest of the digits be 0.
To be divisible by 9, we need sum of
digits be multiple of 9.
And the answer is: 10008
4
Example
In the multiplication problem below, A, B, C and D
are different digits. What is A + B?
ABA
X CD
--------------CDCD
Note that CDCD = CD * 100 + CD = CD * 101
We get: 101 * CD = CDCD
Hence ABA = 101; and A =1, B = 0
Answer: A + B = 1 + 0 = 1
5
Example
Which of the following is divisible by 11?
1) 495 2) 9835 3) 14806 4) 918291
4+5–9 =0
9 + 3 – 8 – 5 = -1
yes
no
1 + 8 + 6 – 4 – 0 = 11
yes
9 + 8 + 9 – 1 - 2 - 1 = 22 yes
6
Factors
Fundamental theorem of arithmetic
Every positive integer has a unique prime factorization
Example: Find all the prime factors of 120?
120 = 12 * 10 = 3 * 4 * 2 * 5 = 23 * 3 * 5
Answer: 2, 3, 5
Example: Find all the factors of 24?
24 = 23 * 3
Answer: 20, 21, 22, 23, and
3* 20, 3* 21, 3* 22, 3* 23
7
Sum of Factors
Example: Find sum of factors of 24?
24 = 23 * 3
The list of factors are 1, 2, 4, 8, 3, 6, 12, 24
The sum = 1 + 2 + 4 + 8 + 3 + 6 + 12 + 24 = 60
Alternatively, we can calculate the sum:
(20 + 21 + 22 + 23) * (30 + 31)
= (1 + 2 + 4 + 8) * (1 + 3)
= 15 * 4 = 60
8
Sum of Factors
For a number X = al * bm * cn
The sum of X’s factors is:
(a0 + a1 + … + al) * (b0 + b1 + … + bm) * (c0 + c1 + … + cn)
Example: Find the sum of factors of 5!?
5! = 5*4*3*2*1 = 120 = 23 * 3 * 5
The sum of its factors:
(20 + 21 + 22 + 23) * (30 + 31) * (50 + 51)
= (1 + 2 + 4 + 8) * (1 + 3) * (1 + 5) = 360
9
LCM and GCF
Find the LCM and GCF of 84 and 140
84 = 2 * 2 * 3 * 7
140 = 2 * 2 * 5 * 7
LCM = 2 * 2 * 3 * 5 * 7 = 420
GCF = 2 * 2 * 7 = 28
84
Use Venn Diagram:
5
2, 2, 7
3
140
10
LCM and GCF
Find the product of LCM and GCF of 45 & 105
45 = 3 * 3 * 5
105 = 3 * 5 * 7
LCM = 3 * 3 * 5 * 7= 315
GCF = 3 * 5 = 15
LCM * GCF = 315 * 15 = 4725
Note that: 45 * 105 = 4725 also!!!
11
Example
The GCF for a pair of numbers is 18, and their
LCM is 180. If one of the number is 90, what is
the other number?
Product of the pair = 18 * 180
Divide by one of the number, we got
the other number:
(18 * 180) / 90 = 18 * 2 = 36
12
Example
How many integers between 1000 and 2000
have all three of the numbers 15, 20 and 25 as
factors?
A number with 15, 20 and 25 as factors must
be divisible by their LCM.
15 = 3 x 5, 20 = 22 x 5, and 25 = 52
LCM(15, 20,25) = 22 x 3 x 52 = 300
Between 1000 and 2000, there are 3 numbers
that are multiple of 300: 1200, 1500, 1800
13
Example
A whole number larger than 2 leaves a remainder of
2 when divided by each of the numbers 3, 4, 5 and 6.
What is the smallest such number?
The smallest whole number that can be
divided by each of 3, 4, 5 and 6 is
LCM{3; 4; 5; 6} = 22 x3x5 = 60
The smallest whole number greater than 2
that leaves a remainder of 2 when divided by
each of 3, 4, 5 and 6 is then: 60 + 2 = 62
14
Example
Two farmers agree that pigs are worth 300 dollars and that
goats are worth 210 dollars. 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 dollar 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?
Let P be # of pigs, and G be # of goats.
The difference will be: D = 300 * P – 210 * G
D = 30 (10 * P - 7 * G)
30 is the GCF of 300 and 210, and D must be a multiple of
30, which can be achieved by P = 5, G = 7. Answer: 30 15
Base Numbers
Examples of different base numbers:
123 = 1 * 102 + 2 * 10 + 1 = 12310
1 hr 2 m 3 sec = 1 * 602 + 2 * 60 + 1 = 12360
‘D’ = 010001002 = 1 * 26 + 0 * 25 + 0 * 24
+ 0 * 23 + 1 * 22 + 0 * 21 + 0 * 20
= 64 + 4 = 6810
16
Example
Find the base 10 value of 7778
Answer:
7778 = 7 * 82 + 7 * 8 + 7 = 511
Find the base 8 representation of 5 * 86 + 2 * 83 + 1
Answer:
5 * 86 + 2 * 83 + 1
= 5 * 86 + 0 + 0 + 2 * 8 3 + 0 + 0 + 1
= 50020018
17
Example
Find the base 2 value of 2510?
25 = 16 + 8 + 1 = 24 + 23 + 20
Answer: 2510 = 110012
Alternatively, we can calculate:
25 / 2 ----------- r 1
12 / 2 ----------- r 0
6 / 2 ----------- r 0
3 / 2 ----------- r 1
1 / 2 ----------- r 1
We get the answer: 110012
18
Example
How many digits will it take to represent 24210 in
base 3?
Note that 24310 = 35 = 1000003
Also note that 24210 = 24310 - 110
We got 24210 = 1000003 - 13 = 22222
We need 5 digits in base 3.
19
Example
What is the last digit of 10! in base-9?
10! = 10 * 9 * 8 * … * 1
which is divisible by 9
Therefore in base-9, the last digit must be 0.
20
Modular Arithmetic
Detect repetition, and simply the problem
with the remainder.
Example: What is the units digit of 24682011 ?
Note that 81 = 8; 82 = …4; 83 = …2; 84 = …6;
85 = …8; 86 = …4; … 2; …6; …
The units digit repeats after every block of 4.
2011 / 4 = … --------- r 3
The last digit of 24682011 = last digit of 24683
Answer: 2
21
Modular Arithmetic
Detect repetition, and simply the problem
with the remainder.
Example: What is the units digit of 24682011 ?
Note that 81 = 8; 82 = …4; 83 = …2; 84 =
…6;
85 = …8; 86 = …4; … 2; …6; …
The units digit repeats after every block of 4.
2011 / 4 = … --------- r 3
The last digit of 24682011 = last digit of 24683
Answer: 2
22
Modular Arithmetic
Strategy: Detect repetition, and simply the
problem using modular arithmetic.
Modular Arithmetic:
X * Y (mod M) = X (mod M) * Y (mod M)
X + Y (mod M) = X (mod M) + Y (mod M)
23
Examples
What is the units digit of 24682011 ?
Note that 81 = 8; 82 = …4; 83 = …2; 84 =
…6;
85 = …8; 86 = …4; … 2; …6; …
The units digit repeats after every block of 4.
2011 / 4 = … --------- r 3
The last digit of 24682011 = last digit of 24683
Answer: 2
24
Modular Arithmetic
What is the remainder when
30 + 31 + 32 + 33 + … + 32009 is divided by 8?
30 / 8 -------- r1
31 / 8 -------- r3
32 / 8 -------- r1
33 / 8 -------- r3
34 / 8 -------- r1
(30 + 31 + 32 + 33 + … + 32009 )/ 8
= (1 + 3 + 1 + 3 + … + 3) /8 (mod 8)
Note that there are 2010/2 = 1005 pairs of (1 + 3)
Answer = 1005 * (1 + 3) / 8 = 4 (mod 8)
25
Even & Odd numbers
even_number + even_number = even_number
even_number + odd_number = odd_number
odd_number + odd_number
= even_number
even_number * even_number = even_number
even_number * odd_number = even_number
odd_number * odd_number = odd_number
26
Example
Barry wrote 6 different numbers, one on each side
of 3 cards, and laid the cards on a table, as shown.
The sums of the two numbers on each of the three
cards are equal. The three numbers on the hidden
sides are prime numbers. What is the average of
the hidden prime numbers?
44
59
38
27
Example
Barry wrote 6 different numbers, one on each side of 3 cards, and laid the cards
on a table, as shown. The sums of the two numbers on each of the three cards are
equal. The three numbers on the hidden sides are prime numbers. What is the
average of the hidden prime numbers?
44
59
38
There are one odd and two even numbers showing
There must be two odd number and one even
number on the other side, all prime numbers!
The only even prime number is 2
Hence we get the common sum: 59 + 2 = 61
And the other two numbers:
61 – 44 = 17; 61 – 38 = 23;
Answer: (2 + 17 + 23) /3 = 14
28