High School Mathematics Extensions/Primes/Solutions

Factorisation Exercises
Factorise the following numbers. (note: I know you didn't have to, this is just for those who are curious)


 * 1) 13 is prime
 * 2) $$26 = 13 \cdot 2$$
 * 3) 59 is prime
 * 4) $$82 = 41 \cdot 2$$
 * 5) 101 is prime
 * 6) $$121 = 11 \cdot 11$$
 * 7) $$2187 = 3 \cdot 3 \cdot 3 \cdot 3 \cdot 3 \cdot 3 \cdot 3$$

Recursive Factorisation Exercises
Factorise using recursion.


 * 1) $$45 = 3 \cdot 3 \cdot 5$$
 * 2) $$4050 = 2 \cdot 3 \cdot 3 \cdot 3 \cdot 3 \cdot 5 \cdot 5$$
 * 3) $$2187 = 3 \cdot 3 \cdot 3 \cdot 3 \cdot 3 \cdot 3 \cdot 3$$

Prime Sieve Exercises

 * 1) Use the above result to quickly work out the numbers that still need to be crossed out in the table below, knowing 5 is the next prime:



\begin{matrix} X & 2_p & 3_p & X & 5 &X &7& X& X& X \\ 11 & X & 13 & X& X& X&17 &X& 19& X\\ X& X& 23 & X& 25 &X&X&X&29& X\\ 31 &X& X& X& 35 &X&37& X& X& X\\ 41 & X& 43 & X& X&X&47& X& 49& X\\ \end{matrix} $$


 * The next prime number is 5. Because 5 is an unmarked prime number, and 5 * 5 = 25, cross out 25. Also, 7 is an unmarked prime number, and 5 * 7 = 35, so cross off 35. However, 5 * 11 = 55, which is too high, so mark 5 as prime ad move on to 7. The only number low enough to be marked off is 7 * 7, which equals 49. You can go no higher.

2. Find all primes below 200.


 * The method will not be outlined here, as it is too long. However, all primes below 200 are:

2     3      5      7     11     13     17     19     23     29 31     37     41     43     47     53     59     61     67     71 73     79     83     89     97    101    103    107    109    113 127    131    137    139    149    151    157    163    167    173 179    181    191    193    197    199

Modular Arithmetic Exercises

 * 1) $$(-1) \cdot (-5)\mod{11} = 5$$alternatively, -1 = 10, -5 = 6: 10 &times; 6 = 60 = 5&times 11 + 5 = 5
 * 2) $$3 \cdot 7 \mod{11} = 21 = 10$$
 * 3) $$2^1 = 2, 2^2 = 4, 2^3 = 8, 2^4 = 16 = 5$$ $$ 2^5 = 32 = 10, 2^6 = 64 = 9, 2^7 = 128 = 7$$ $$ 2^8 = 256 = 3, 2^9 = 512 = 6, 2^{10} = 1024 = 1$$ An easier list: 2, 4, 8, 5, 10, 9, 7, 3, 6, 1 Notice that it is not necessary to actually compute $$2^{10}$$ to find $$2^{10}$$ mod 11. If you know $$2^9$$ mod 11 = 6.  You can find $$2^{10}$$ mod 11 = (2*($$2^9$$ mod 11)) mod 11 = 2*6 mod 11 = 12 mod 11 = 1.  We can note that 29 = 6 and 210 = 1, we can calculate 62 easily: 62 = 218 = 2^8 = 3. OR by the above method $$6^1 = 6, 6^2 = 36 = 3, 6^3 = 6*3 = 18 = 7, $$ $$6^4 = 6*7 = 42 = 9, 6^5 = 6*9 = 54 = 10, 6^6 = 6*10 = 60 = 5, $$ $$6^7 = 6*5 = 30 = 8, 6^8 = 6*8 = 48 = 4, 6^9 = 6*4 = 24 = 2, 6^{10} = 6*2 = 12 = 1.$$ An easier list: 6, 3, 7, 9, 10, 5, 8, 4, 2, 1.
 * 4) 02 = 0, 12 = 1, 22 = 4, 32 = 9, 42 = 16 = 5, 52 = 25 = 5, 62 = 36 = 3, 72 = 49 = 3, 82 = 64 = 9, 92 = 81 = 4, 102 = 100 = 1 An easier list: 0, 1, 4, 9, 5, 3, 3, 5, 9, 4, 1 Thus$$\sqrt{4}=2\mbox{ and }\sqrt{4}=9$$
 * 5) x2 = -2 = 9 Just look at the list above and you'll see that$$\sqrt{-2}=8\mbox{ and }\sqrt{-2}=3$$

Division and Inverses Exercises
1.
 * $$x = 2^{-1} = 4$$
 * $$x = 3^{-1} = 5$$
 * $$x = 4^{-1} = 2$$
 * $$x = 5^{-1} = 3$$
 * $$x = 6^{-1} = 6$$
 * $$x = 7^{-1} = 0^{-1}$$ therefore the inverse does not exist

2. $$x = \frac{28}{7} = 4 \ \ \mbox{(mod 29)}$$
 * $$7^{-1} = 25 \ \ \mbox{(mod 29)}$$
 * $$x = 28\cdot 25 = 4 \ \ \mbox{(mod 29)}$$

3.
 * $$x = 5^{99} \times (40 + \frac{1}{3}) \ \ \mbox{(mod 11)}$$
 * $$x = 5^{99} \times (40 + 4) \ \ \mbox{(mod 11)}$$
 * $$x = 5^{99} \times 0 \ \ \mbox{(mod 11)}$$
 * $$x = 0  \ \ \mbox{(mod 11)}$$

4.

Coprime and greatest common divisor Exercises
1.
 * 1.


 * 5050 and 5051 are coprime
 * 2.


 * 59 and 79 are coprime
 * 3.


 * 111 and 369 are not coprime
 * 4.


 * 2021 and 4032 are coprime

2. We first calculate the gcd for all combinations


 * The gcd for any combination of the numbers is 15 so the gcd is 15 for the three numbers.

Diophantine equation Exercises
1.

\begin{matrix} 216x &=& 1 + 816b\\ 216c &=& 1 + 168b\\ 48c &=& 1 + 168d\\ 48e &=& 1 + 24d\\ 24e &=& 1 + 24f\\ \end{matrix} $$
 * There is no solution, because can never become an integer.

2.

\begin{matrix} 42x &=& 7 + 217b\\ 42c &=& 7 + 7b\\ 7c &=& 0 + 7d\\ \end{matrix} $$
 * We choose d=1, then x=26.

3.
 * (a)


 * (b) To be added

4.
 * (a)


 * (b) To be added

Chinese remainder theorem exercises
1.

\begin{matrix} 3x &\equiv& 5 \pmod{14}\\ x &\equiv& 11 \pmod{14}\\ x &=& 11 + 14 a\\ 2x &=& 2(11 + 14a) &\equiv& -3 \pmod{17}\\ & & 22 + 28 a &\equiv& -3 \pmod{17}\\ & & 11 a &\equiv& -8 \pmod{17}\\ & & a &=& 7 + 17b\\ x &=& 11 + 14(7 + 17b) &\equiv& 6 \pmod{15}\\ &=& 109 + 238b &\equiv& 6 \pmod{15}\\ &=& 4 + 13b &\equiv& 6 \pmod{15}\\ &=& 13b &\equiv& 2 \pmod{15}\\ && b &\equiv& 14 \pmod{15}\\ && b &= &14 + 15c\\ x &=& 109 + 238(14 + 15c)\\ x &=& 3441 + 3570c \end{matrix} $$

Question 1
Show that the divisible-by-3 theorem works for any 3 digits numbers (Hint: Express a 3 digit number as 100a + 10b + c, where a, b and c are ≥ 0 and < 10)

Solution 1 Any 3 digits integer x can be expressed as follows
 * x = 100a + 10b + c

where a, b and c are positive integer between 0 and 9 inclusive. Now

x \equiv 100a + 10b + c \equiv a + b + c \pmod{3} $$

x \equiv 0 \pmod{3} $$ if and only if a + b + c = 3k for some k. But a, b and c are the digits of x.

Question 2
"A number is divisible by 9 if and only if the sum of its digits is divisible by 9." True or false? Determine whether 89, 558, 51858, and 41857 are divisible by 9. Check your answers.

Solution 2 The statement is true and can be proven as in question 1.

Question 4
The prime sieve has been applied to the table of numbers above. Notice that every number situated directly below 2 and 5 are crossed out. Construct a rectangular grid of numbers running from 1 to 60 so that after the prime sieve has been performed on it, all numbers situated directly below 3 and 5 are crossed out. What is the width of the grid?

Solution 4 The width of the grid should be 15 or a multiple of it.

Question 6
Show that n - 1 has itself as an inverse modulo n.

Solution 6
 * (n - 1)2 = n2 - 2n + 1 = 1 (mod n)

Alternatively
 * (n - 1)2 = (-1)2 = 1 (mod n)

Question 7
Show that 10 does not have an inverse modulo 15.

Solution 7 Suppose 10 does have an inverse x mod 15,
 * 10x = 1 (mod 15)
 * 2&times;5x = 1 (mod 15)
 * 5x = 8 (mod 15)
 * 5x = 8 + 15k

for some integer k
 * x = 1.6 + 3k

but now x is not an integer, therefore 10 does not have an inverse