100% found this document useful (1 vote)
303 views18 pages

Prime Numbers and Divisibility Rule

The document discusses several topics related to number theory including: 1) Definitions of prime numbers, composite numbers, and the fundamental theorem of arithmetic. 2) Proofs that there are infinitely many prime numbers. 3) Methods for finding prime numbers like the sieve of Eratosthenes. 4) Tests for primality like checking all divisors up to the square root. 5) Open conjectures like Goldbach's conjecture and modular arithmetic.

Uploaded by

avika
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
303 views18 pages

Prime Numbers and Divisibility Rule

The document discusses several topics related to number theory including: 1) Definitions of prime numbers, composite numbers, and the fundamental theorem of arithmetic. 2) Proofs that there are infinitely many prime numbers. 3) Methods for finding prime numbers like the sieve of Eratosthenes. 4) Tests for primality like checking all divisors up to the square root. 5) Open conjectures like Goldbach's conjecture and modular arithmetic.

Uploaded by

avika
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 18

PRIME NUMBERS AND

DIVISIBILITY RULE
 If a and b are integers and there is some integer c such
that a = b · c, then we say that b divides a or is a factor
or divisor of a and write b|a.

Definition (Prime Number): A prime number is an


integer greater than 1 whose only positive divisors are
itself and 1. A non-prime number greater than 1 is called
a composite number.

Theorem (The Fundamental Theorem of Arithmetic).


Every positive integer greater than 1 may be expressed as a
product of primes and this representation is unique up to the
order in which the factors are written.Theorem. There are
infinitely many prime numbers.

Proof: Suppose otherwise. Then there would be a finite


number n of primes, which we may denote by p1, p2,
p3, . . . , pn. Consider x = p1·p2· p3 . . . pn + 1. There must be
some prime number greater than 1 which divides x, but
clearly x is not divisible by any of p1, p2, p3, . . . , pn. This

1
contradicts the assumption that there is are finitely many
primes, proving there are infinitely many.

2
Sieve of Erastothenes

 The Sieve of Erastothenes is a technique which may be


used to determine all the prime numbers up to a certain
size. One writes down all the integers up to that size.
One then crosses out all the multiples of 2 (the even
numbers) greater than 2. At each step, one takes the
smallest number left whose multiples haven’t been
crossed out and crosses out all its multiples. One is
ultimately left only with the prime numbers.

3
Test for Primality

 One may check every integer less than the number’s


square root. If none are divisors, then the integer is
prime.
 This may be seen by recognizing that if an integer n is
not prime, there must be integers p ≤ q both dividing n.
But then p 2 ≤ pq ≤ n, so p ≤ √ n. So every non-prime
number must have a divisor no greater than its square
root. There are much more sophisticated tests for
primality.

Goldbach’s Conjecture

4
 Goldbach’s Conjecture is that every even integer
greater than 4 may be written as a sum of two odd
primes. Goldbach’s Conjecture has been shown to hold
for all even integers up to 400 trillion, but has not yet
been proven in general. Hence, it remains a conjecture
rather than a theorem*. Theorem (The Division
Algorithm). If a, b are integers with b > 0, then there
exist unique integers q, r such that a = q · b + r with 0 ≤ r
< b. q is called the quotient and r is called the remainder.

Note: The Division Algorithm is not an algorithm!


 Any number which divides both a and b also divides
both b and r and visa versa. Definition (Greatest
Common Divisor). The greatest common divisor of
integers a and b is the largest positive integer which
divides both a and b. We denote the greatest common
divisor by gcd(a, b) or simply (a, b).

5
The Euclidean Algorithm gives a method (an algorithm!)
for finding the greatest common divisor of any two
positive integers:
 Given a, b, we apply the Euclidean Algorithm and find
(a, b) = (b, r). We then apply the Euclidean Algorithm to
the pair b, r. We keep repeating the process, each time
getting a new pair of numbers with the same gcd as a,
b, until we get two numbers such that one divides the
other. That divisor is the gcd we’re looking for.

Modular Arithmetic

 Definition (mod): If a is an integer and n is a positive


integer, then a mod n is the remainder obtained when
we divide a by n using the Euclidean Algorithm.

6
 Definition (congruence) : If n is a positive integer, two
integers a, b are said to be congruent modulo n if they
both have the same remainder when divided by n. We
write a ≡ b mod n. Corollary. a ≡ b mod n if and only if n|
(a − b).

 Modular arithmetic has many of the same properties as


ordinary arithmetic. We may define addition,
subtraction and multiplication modulo n because it is
easily seen that if a ≡ b mod n and c ≡ d mod n, then:

1. a + c ≡ b + d mod n
2. a − c ≡ b − d mod n
3. a · b ≡ b · d mod n

Divisibility Tests

o Modular arithmetic may be used to show the


validity of a number of common divisibility tests.

Casting Out Nines

7
 A test for divisibility is called Casting Out Nines:
Theorem: A positive integer is divisible by 9 if and only if
the sum of its digits is divisible by 9.
o Proof. Since 10 ≡ 1 mod 9, it follows that 10n ≡ 1
mod 9 for any positive integer n. Given any integer
N, we may write N = am · 10m + am−1
·10m−1+am−2 ·10m−2+. . . a0 ·100, where a0, a1,
a2, . . . am are the digits in N. But then N ≡ am · 1 +
am−1 · 1 + · · · + a0 mod 9.

Essentially the same reasoning shows:

Theorem: A positive integer is divisible by 3 if and only if


the sum of its digits is divisible by 3.

8
A variation gives a method called Casting out Elevens for
testing divisibility by 11. It’s based on the fact that 10 ≡
−1 mod 11, so 10n ≡ (−1)n mod 11.
o Theorem (Casting Out Elevens). A positive integer
is divisible by 11 if and only if the alternating sum
of its digits is divisible by 11.

9
 Proof. Since 10 ≡ −1 mod 9, it follows that 10n ≡ (−1)n
mod 11 for any positive integer n. Given any integer N,
we may write N = am · 10m+am−1 ·10m−1+am−2
·10m−2+. . . a0 ·100 , where a0, a1, a2, . . . am are the
digits in N. But then N ≡ am ·(−1)m+am−1 ·(−1)m−1+· ·
·+a0 mod 11 ≡ a0 − a1 + a2 − a3 + · · · + (−1)mam
mod 11.

Other Tests
 Divisibility By 2 – The units digit must be even.
 Divisibility By 4 – The number formed by its last two
digits must be divisible by 4.
 Divisibility By 5 – The units digit must be 0 or 5.
 Divisibility By 6 – It must be even and divisible by 3.
10
 Divisibility By 7 – When the units digit is doubled and
subtracted from the number formed by the remaining
digits, the resulting number must be divisible by 7. (To
verify, write the original number in the form 10a + b ≡
3a + b mod 7, so the resulting number is a − 2b, and
check the possible ways for 3a + b to be divisible by 7.)
 Divisibility By 8 – The number formed by its last three
digits must be divisible by 8.
 Divisibility By 10 – Its last digit must be 0.

Check Digits

 Definition (Check Digit). A check digit is an extra digit


tacked onto a number which is mathematically related
in some way to the other digits.
o Example: Airline Tickets – The check digit is the
main part mod 7.
11
o U.S. Postal Service Money Orders – The check digit
is the main part mod 9.
 These do not catch all single-digit errors nor do they
catch transposition errors.

Bank Identification Number Check Digit Formula: Every bank


has a nine digit identification number of the form
a8a7a6a5a4a3a2a1a0 where a0 =
(7a8+3a7+9a6+7a5+3a4+9a3+7a2+ 3a1) mod 10.

12
UPC Number Check Digit Formula: a0 is chosen so
(3a11+a10+3a9+a8+3a7+a6+3a5+ a4 + 3a3 + a2 + 3a1) ≡ 0
mod 10.

ISBN Check Digit Formula: a0 ≡ (a9 + 2a8 +


3a7+4a6+5a5+6a4+7a3+8a2+9a1) mod 11. There is a check
digit method that detects all single-digit and transposition
errors and only generates 0 through 9 as a check digit.

13
Tournament Scheduling Problem:
 How do we schedule the teams playing in a round-robin
tournament?
Solution:
 Let N be the number of teams in the tournament and
number the teams 1, 2, 3, . . . , N.
 Let Tm,r be the team which Team m plays in Round r.
 If there is an odd number of teams, we let Tm,r be the
unique integer between 1 and N such that
Tm,r ≡ r − m mod N.
 If Tm,r = m, then Team m gets a bye.
 If there is an even number of teams, we schedule the
teams as if there was one fewer team and let the team
that would otherwise get a bye play the last team.

14
Cryptology
 Definition (Cryptology). Cryptology is the discipline of
encoding and decoding messages.

Cryptology is critical in everyday life today. Our banking


system, including the ability to use ATM’s and to do online
banking, would collapse without the ability to securely
transmit financial information over public networks.
Cryptology has played a crucial role in history. Many believe
that World War II was shortened by several years because
the Allies were able to crack the secret codes used by the
Axis powers.
Definition (Cipher). A cipher is a method for encoding
messages. Definition (Plaintext). Plaintext refers to the
original text that is being encoded.
Definition (Ciphertext). Ciphertext refers to the
encoded message.
Definition (Enciphering, Encryption). The process of
encoding a message is sometimes referred to as
enciphering or encryption.
Definition (Deciphering, Decryption). The process of
Decoding a message is sometimes referred to as
deciphering or decryption.

15
 The Caesar Cipher
 The Caesar Cipher is one of the earliest known ciphers
and was used by Julius Casar. Each letter in a message is
simply replaced by the letter coming three letters after it
in the alphabet.

problem: What about x, y and z?


 solution: Replace them with a, b and c.
We may make this somewhat quantitative by assigning a
numerical value to each letter: 0 to A, 1 to B, 2 to C, . . . ,
25 to Z. If we let P represent the numerical value of a given
letter in plaintext and C represent the number it is
replaced by in ciphertext, we have
 C ≡ (P + 3) mod 26.
To decode, we have
 P ≡ (C − 3) mod 26.
More generally, we might use a shift other than 3 and let C ≡
(P + b) mod 26 for some other integer b.
We might mix things up a little more and let
 C ≡ (aP + b) mod 26 (1)
For some choice of integers a and b. Such a cipher would be
called an affine cipher.

16
To decode, we could try to solve the congruence (1) for P in
terms of C. We might proceed as follows:
 C ≡ aP + b mod 26,
 aP ≡ C − b mod 26,
 P ≡ a −1(C − b) mod 26.
Question: What is a^ −1, the multiplicative inverse of a?
It would have to be a number such that a·a −1 ≡ 1 mod 26.
It turns out that not all integers have such an inverse. For
example, no even numbers could have inverses mod 26 since
any multiple of an even number would be even and could
only be congruent to another even integer and thus could
not possibly be congruent to 1. Theorem 1. An integer a has a
multiplicative inverse mod n if and only if a and n have no
factors in common other than 1, in other words, if (a, n) = 1.

17
Hill Cipher

 With the Hill Cipher, blocks of letters are encoded


simultaneously rather than encoding letters separately
in a method similar to an affine cipher. For a block of
two letters, P1, P2, the corresponding encoded letters
C1, C2 would be determined by the formulas.
 C1 ≡ (aP1 + bP2) mod 26
 C2 ≡ (cP1 + dP2) mod 26,
where a, b, c, d are integers.

18

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy