24.10.2014 Views

Modular Arithmetic Recap We use the notation an...a2a1a0 for the ...

Modular Arithmetic Recap We use the notation an...a2a1a0 for the ...

Modular Arithmetic Recap We use the notation an...a2a1a0 for the ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Modular</strong> <strong>Arithmetic</strong> <strong>Recap</strong><br />

<strong>We</strong> <strong>use</strong> <strong>the</strong> <strong>notation</strong> a n ...a 2 a 1 a 0 <strong>for</strong> <strong>the</strong> number <strong>for</strong>med with <strong>the</strong> digits a 0 , a 1 , ..., a n ,<br />

so that:<br />

a n ...a 2 a 1 a 0 = a 0 + 10a 1 + 100a 2 + ... + 10 n a n .<br />

Fix a number p. By reducing each power of 10 modulo p, we c<strong>an</strong> find simplified ways<br />

of writing a n ...a 2 a 1 a 0 ( mod p) .<br />

Thus:<br />

a n ...a 2 a 1 a 0 ≡ a 0 ( mod 2)<br />

beca<strong>use</strong> 10 k ≡ 0 ( mod 2) <strong>for</strong> all k ≥ 1.<br />

a n ...a 2 a 1 a 0 ≡ a 0 + a 1 + a 2 + ... + a n ( mod 3)<br />

beca<strong>use</strong> 10 k = 99...9 + 1 ≡ 1 ( mod 3) <strong>for</strong> all k ≥ 1.<br />

a n ...a 2 a 1 a 0 ≡ a 1 a 0 ( mod 4)<br />

beca<strong>use</strong> 10 k ≡ 0 ( mod 4) <strong>for</strong> all k ≥ 2.<br />

a n ...a 2 a 1 a 0 ≡ a 0 ( mod 5)<br />

beca<strong>use</strong> 10 k ≡ 0 ( mod 5) <strong>for</strong> all k ≥ 1.<br />

a n ...a 2 a 1 a 0 ≡ 4(a 0 + a 1 + a 2 + ... + a n ) ( mod 6)<br />

beca<strong>use</strong> 10 k ≡ 4<br />

( mod 6) <strong>for</strong> all k ≥ 1 (Prove this by induction).<br />

a n ...a 2 a 1 a 0 ≡ a 0 + 3a 1 + 2a 2 − a 3 − 3a 4 − 2a 5 + a 6 + 3a 7 + 2a 8 ...) ( mod 7)<br />

beca<strong>use</strong><br />

10 ≡ 3 ( mod 7) =⇒<br />

10 2 ≡ 3 2 ≡ 2 ( mod 7) =⇒<br />

10 3 ≡ 2 × 3 ≡ −1 ( mod 7) =⇒<br />

10 4 ≡ −1 × 3 ≡ −3 ( mod 7) =⇒ ...<br />

a n ...a 2 a 1 a 0 ≡ a 2 a 1 a 0 ( mod 8)<br />

beca<strong>use</strong> 10 k ≡ 0 ( mod 8) <strong>for</strong> all k ≥ 3.<br />

a n ...a 2 a 1 a 0 ≡ a 0 + a 1 + a 2 + ... + a n ( mod 9)<br />

beca<strong>use</strong> 10 k = 99...9 + 1 ≡ 1 ( mod 9) <strong>for</strong> all k ≥ 1.<br />

a n ...a 2 a 1 a 0 ≡ a 0 ( mod 10).<br />

a n ...a 2 a 1 a 0 ≡ a 0 − a 1 + a 2 + ... + (−1) n a n ( mod 11)<br />

beca<strong>use</strong> 10 k =≡ (−1) k ( mod 11) <strong>for</strong> all k ≥ 0.<br />

a n ...a 2 a 1 a 0 ≡ a 2 a 1 a 0 − a 5 a 4 a 3 + a 8 a 7 a 6 − ... ( mod 1001)<br />

beca<strong>use</strong> 10 3k ≡ (−1) k ( mod 1001) <strong>for</strong> all k ≥ 3.<br />

This last equality c<strong>an</strong> prove <strong>use</strong>ful when you work mod 7, 11 or 13 beca<strong>use</strong><br />

1001 = 7 × 11 × 13 .<br />

1


2<br />

Perfect squares<br />

Which numbers n c<strong>an</strong> be perfect squares?<br />

Note: There are only p equivalence classes (mod p): n = 0, 1, 2, ..., or p − 1.<br />

As n 2 ≡ (−n) 2 ≡ (p − n) 2 ( mod p), , <strong>the</strong>re are at most p/2 possible values that<br />

a perfect square c<strong>an</strong> take mod p:<br />

n 2 ≡ 0 or 1 ( mod 3),<br />

beca<strong>use</strong> 02 ≡ 0 ( mod 3),<br />

1 2 ≡ 2 2 ≡ 1 ( mod 3).<br />

n 2 ≡ 0 or 1 ( mod 4),<br />

beca<strong>use</strong> 02 ≡ 2 2 ≡ 0 ( mod 4),<br />

1 2 ≡ 3 2 ≡ 1 ( mod 4).<br />

n 2 ≡ 0 or 1 or −1 ( mod 5),<br />

beca<strong>use</strong> 12 ≡ 4 2 ≡ 1 ( mod 4),<br />

2 2 ≡ 3 2 ≡ −1 ( mod 4),<br />

.................................................................................................................<br />

n 2 ≡ 0 or 1 or 4 or 5 or 6 or 9 ( mod 10).<br />

...............................................................................................................<br />

If p is prime, <strong>the</strong>n p 2 ≡ 1 ( mod 12) .<br />

Indeed, looking at <strong>the</strong> factors of 12k, 12k +2, 12k +3, 12k +4, 12k +6, 12k +8, 12k +<br />

9, 12k + 10 we see <strong>the</strong>se c<strong>an</strong>’t be written as p 2 <strong>for</strong> p prime.<br />

Then 12k + 5 ≡ 12k + 11 ≡ 2 ( mod 3) so <strong>the</strong>y c<strong>an</strong>’t be perfect squares, <strong>an</strong>d<br />

12k + 7 ≡ 3 ( mod 4) so it c<strong>an</strong>’t be a perfect square.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!