Top Banner
MAS114: Lecture 17 James Cranch http://cranch.staff.shef.ac.uk/mas114/ 2017–2018
51

MAS114: Lecture 17 - University of Sheffieldcranch.staff.shef.ac.uk/mas114/docs/slides/mas114-slides17-public... · MAS114: Lecture 17 James Cranch http ... An early Christmas present

May 19, 2018

Download

Documents

hoangduong
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: MAS114: Lecture 17 - University of Sheffieldcranch.staff.shef.ac.uk/mas114/docs/slides/mas114-slides17-public... · MAS114: Lecture 17 James Cranch http ... An early Christmas present

MAS114: Lecture 17

James Cranch

http://cranch.staff.shef.ac.uk/mas114/

2017–2018

Page 2: MAS114: Lecture 17 - University of Sheffieldcranch.staff.shef.ac.uk/mas114/docs/slides/mas114-slides17-public... · MAS114: Lecture 17 James Cranch http ... An early Christmas present

An early Christmas present

I’ve put online my number theory tool, to help you revise.http://cranch.staff.shef.ac.uk/ntaas/

It’s linked from the main course webpage.

Page 3: MAS114: Lecture 17 - University of Sheffieldcranch.staff.shef.ac.uk/mas114/docs/slides/mas114-slides17-public... · MAS114: Lecture 17 James Cranch http ... An early Christmas present

An early Christmas present

I’ve put online my number theory tool, to help you revise.

http://cranch.staff.shef.ac.uk/ntaas/

It’s linked from the main course webpage.

Page 4: MAS114: Lecture 17 - University of Sheffieldcranch.staff.shef.ac.uk/mas114/docs/slides/mas114-slides17-public... · MAS114: Lecture 17 James Cranch http ... An early Christmas present

An early Christmas present

I’ve put online my number theory tool, to help you revise.http://cranch.staff.shef.ac.uk/ntaas/

It’s linked from the main course webpage.

Page 5: MAS114: Lecture 17 - University of Sheffieldcranch.staff.shef.ac.uk/mas114/docs/slides/mas114-slides17-public... · MAS114: Lecture 17 James Cranch http ... An early Christmas present

An early Christmas present

I’ve put online my number theory tool, to help you revise.http://cranch.staff.shef.ac.uk/ntaas/

It’s linked from the main course webpage.

Page 6: MAS114: Lecture 17 - University of Sheffieldcranch.staff.shef.ac.uk/mas114/docs/slides/mas114-slides17-public... · MAS114: Lecture 17 James Cranch http ... An early Christmas present

A remark

RemarkFermat’s Little Theorem should not be confused with Fermat’s LastTheorem. The latter says there are no solutions in positive integersto an ` bn “ cn with n ě 3, and was much, much harder to prove.

Page 7: MAS114: Lecture 17 - University of Sheffieldcranch.staff.shef.ac.uk/mas114/docs/slides/mas114-slides17-public... · MAS114: Lecture 17 James Cranch http ... An early Christmas present

A remark

RemarkFermat’s Little Theorem should not be confused with Fermat’s LastTheorem.

The latter says there are no solutions in positive integersto an ` bn “ cn with n ě 3, and was much, much harder to prove.

Page 8: MAS114: Lecture 17 - University of Sheffieldcranch.staff.shef.ac.uk/mas114/docs/slides/mas114-slides17-public... · MAS114: Lecture 17 James Cranch http ... An early Christmas present

A remark

RemarkFermat’s Little Theorem should not be confused with Fermat’s LastTheorem. The latter says there are no solutions in positive integersto an ` bn “ cn with n ě 3

, and was much, much harder to prove.

Page 9: MAS114: Lecture 17 - University of Sheffieldcranch.staff.shef.ac.uk/mas114/docs/slides/mas114-slides17-public... · MAS114: Lecture 17 James Cranch http ... An early Christmas present

A remark

RemarkFermat’s Little Theorem should not be confused with Fermat’s LastTheorem. The latter says there are no solutions in positive integersto an ` bn “ cn with n ě 3, and was much, much harder to prove.

Page 10: MAS114: Lecture 17 - University of Sheffieldcranch.staff.shef.ac.uk/mas114/docs/slides/mas114-slides17-public... · MAS114: Lecture 17 James Cranch http ... An early Christmas present

More generality

In the proof of Fermat’s Little Theorem, we multiplied onerepresentative of each invertible residue class together. It turns outwe can prove a substantially more general theorem, but it’s a littlemore complicated. First we need a definition:

DefinitionEuler’s function (sometimes known as the totient functionϕ : NÑ N is defined by taking ϕpnq to be the number of integersbetween 1 and n (inclusive) which are coprime to n.

For example, ϕppq “ p ´ 1 if p is prime, since every number from1 to p ´ 1 is coprime to p (and p isn’t coprime to p).For another example, ϕp6q “ 2, since 1 and 5 are the only numbersbetween 1 and 6 which are coprime to 6.

Page 11: MAS114: Lecture 17 - University of Sheffieldcranch.staff.shef.ac.uk/mas114/docs/slides/mas114-slides17-public... · MAS114: Lecture 17 James Cranch http ... An early Christmas present

More generality

In the proof of Fermat’s Little Theorem, we multiplied onerepresentative of each invertible residue class together.

It turns outwe can prove a substantially more general theorem, but it’s a littlemore complicated. First we need a definition:

DefinitionEuler’s function (sometimes known as the totient functionϕ : NÑ N is defined by taking ϕpnq to be the number of integersbetween 1 and n (inclusive) which are coprime to n.

For example, ϕppq “ p ´ 1 if p is prime, since every number from1 to p ´ 1 is coprime to p (and p isn’t coprime to p).For another example, ϕp6q “ 2, since 1 and 5 are the only numbersbetween 1 and 6 which are coprime to 6.

Page 12: MAS114: Lecture 17 - University of Sheffieldcranch.staff.shef.ac.uk/mas114/docs/slides/mas114-slides17-public... · MAS114: Lecture 17 James Cranch http ... An early Christmas present

More generality

In the proof of Fermat’s Little Theorem, we multiplied onerepresentative of each invertible residue class together. It turns outwe can prove a substantially more general theorem, but it’s a littlemore complicated.

First we need a definition:

DefinitionEuler’s function (sometimes known as the totient functionϕ : NÑ N is defined by taking ϕpnq to be the number of integersbetween 1 and n (inclusive) which are coprime to n.

For example, ϕppq “ p ´ 1 if p is prime, since every number from1 to p ´ 1 is coprime to p (and p isn’t coprime to p).For another example, ϕp6q “ 2, since 1 and 5 are the only numbersbetween 1 and 6 which are coprime to 6.

Page 13: MAS114: Lecture 17 - University of Sheffieldcranch.staff.shef.ac.uk/mas114/docs/slides/mas114-slides17-public... · MAS114: Lecture 17 James Cranch http ... An early Christmas present

More generality

In the proof of Fermat’s Little Theorem, we multiplied onerepresentative of each invertible residue class together. It turns outwe can prove a substantially more general theorem, but it’s a littlemore complicated. First we need a definition:

DefinitionEuler’s function (sometimes known as the totient functionϕ : NÑ N is defined by taking ϕpnq to be the number of integersbetween 1 and n (inclusive) which are coprime to n.

For example, ϕppq “ p ´ 1 if p is prime, since every number from1 to p ´ 1 is coprime to p (and p isn’t coprime to p).For another example, ϕp6q “ 2, since 1 and 5 are the only numbersbetween 1 and 6 which are coprime to 6.

Page 14: MAS114: Lecture 17 - University of Sheffieldcranch.staff.shef.ac.uk/mas114/docs/slides/mas114-slides17-public... · MAS114: Lecture 17 James Cranch http ... An early Christmas present

More generality

In the proof of Fermat’s Little Theorem, we multiplied onerepresentative of each invertible residue class together. It turns outwe can prove a substantially more general theorem, but it’s a littlemore complicated. First we need a definition:

DefinitionEuler’s function (sometimes known as the totient functionϕ : NÑ N is defined by taking ϕpnq to be the number of integersbetween 1 and n (inclusive) which are coprime to n.

For example, ϕppq “ p ´ 1 if p is prime, since every number from1 to p ´ 1 is coprime to p (and p isn’t coprime to p).For another example, ϕp6q “ 2, since 1 and 5 are the only numbersbetween 1 and 6 which are coprime to 6.

Page 15: MAS114: Lecture 17 - University of Sheffieldcranch.staff.shef.ac.uk/mas114/docs/slides/mas114-slides17-public... · MAS114: Lecture 17 James Cranch http ... An early Christmas present

More generality

In the proof of Fermat’s Little Theorem, we multiplied onerepresentative of each invertible residue class together. It turns outwe can prove a substantially more general theorem, but it’s a littlemore complicated. First we need a definition:

DefinitionEuler’s function (sometimes known as the totient functionϕ : NÑ N is defined by taking ϕpnq to be the number of integersbetween 1 and n (inclusive) which are coprime to n.

For example, ϕppq “ p ´ 1 if p is prime

, since every number from1 to p ´ 1 is coprime to p (and p isn’t coprime to p).For another example, ϕp6q “ 2, since 1 and 5 are the only numbersbetween 1 and 6 which are coprime to 6.

Page 16: MAS114: Lecture 17 - University of Sheffieldcranch.staff.shef.ac.uk/mas114/docs/slides/mas114-slides17-public... · MAS114: Lecture 17 James Cranch http ... An early Christmas present

More generality

In the proof of Fermat’s Little Theorem, we multiplied onerepresentative of each invertible residue class together. It turns outwe can prove a substantially more general theorem, but it’s a littlemore complicated. First we need a definition:

DefinitionEuler’s function (sometimes known as the totient functionϕ : NÑ N is defined by taking ϕpnq to be the number of integersbetween 1 and n (inclusive) which are coprime to n.

For example, ϕppq “ p ´ 1 if p is prime, since every number from1 to p ´ 1 is coprime to p (and p isn’t coprime to p).

For another example, ϕp6q “ 2, since 1 and 5 are the only numbersbetween 1 and 6 which are coprime to 6.

Page 17: MAS114: Lecture 17 - University of Sheffieldcranch.staff.shef.ac.uk/mas114/docs/slides/mas114-slides17-public... · MAS114: Lecture 17 James Cranch http ... An early Christmas present

More generality

In the proof of Fermat’s Little Theorem, we multiplied onerepresentative of each invertible residue class together. It turns outwe can prove a substantially more general theorem, but it’s a littlemore complicated. First we need a definition:

DefinitionEuler’s function (sometimes known as the totient functionϕ : NÑ N is defined by taking ϕpnq to be the number of integersbetween 1 and n (inclusive) which are coprime to n.

For example, ϕppq “ p ´ 1 if p is prime, since every number from1 to p ´ 1 is coprime to p (and p isn’t coprime to p).For another example, ϕp6q “ 2

, since 1 and 5 are the only numbersbetween 1 and 6 which are coprime to 6.

Page 18: MAS114: Lecture 17 - University of Sheffieldcranch.staff.shef.ac.uk/mas114/docs/slides/mas114-slides17-public... · MAS114: Lecture 17 James Cranch http ... An early Christmas present

More generality

In the proof of Fermat’s Little Theorem, we multiplied onerepresentative of each invertible residue class together. It turns outwe can prove a substantially more general theorem, but it’s a littlemore complicated. First we need a definition:

DefinitionEuler’s function (sometimes known as the totient functionϕ : NÑ N is defined by taking ϕpnq to be the number of integersbetween 1 and n (inclusive) which are coprime to n.

For example, ϕppq “ p ´ 1 if p is prime, since every number from1 to p ´ 1 is coprime to p (and p isn’t coprime to p).For another example, ϕp6q “ 2, since 1 and 5 are the only numbersbetween 1 and 6 which are coprime to 6.

Page 19: MAS114: Lecture 17 - University of Sheffieldcranch.staff.shef.ac.uk/mas114/docs/slides/mas114-slides17-public... · MAS114: Lecture 17 James Cranch http ... An early Christmas present

Fermat-Euler

Using this concept, we can generalise Fermat’s Little Theoremconsiderably:

Theorem (Fermat-Euler Theorem)

Let a and n be integers with gcdpa, nq “ 1. Then

aϕpnq ” 1 pmod nq.

Proof.

?

Page 20: MAS114: Lecture 17 - University of Sheffieldcranch.staff.shef.ac.uk/mas114/docs/slides/mas114-slides17-public... · MAS114: Lecture 17 James Cranch http ... An early Christmas present

Fermat-Euler

Using this concept, we can generalise Fermat’s Little Theoremconsiderably:

Theorem (Fermat-Euler Theorem)

Let a and n be integers with gcdpa, nq “ 1. Then

aϕpnq ” 1 pmod nq.

Proof.

?

Page 21: MAS114: Lecture 17 - University of Sheffieldcranch.staff.shef.ac.uk/mas114/docs/slides/mas114-slides17-public... · MAS114: Lecture 17 James Cranch http ... An early Christmas present

Fermat-Euler

Using this concept, we can generalise Fermat’s Little Theoremconsiderably:

Theorem (Fermat-Euler Theorem)

Let a and n be integers with gcdpa, nq “ 1. Then

aϕpnq ” 1 pmod nq.

Proof.

?

Page 22: MAS114: Lecture 17 - University of Sheffieldcranch.staff.shef.ac.uk/mas114/docs/slides/mas114-slides17-public... · MAS114: Lecture 17 James Cranch http ... An early Christmas present

Fermat-Euler

Using this concept, we can generalise Fermat’s Little Theoremconsiderably:

Theorem (Fermat-Euler Theorem)

Let a and n be integers with gcdpa, nq “ 1. Then

aϕpnq ” 1 pmod nq.

Proof.

?

Page 23: MAS114: Lecture 17 - University of Sheffieldcranch.staff.shef.ac.uk/mas114/docs/slides/mas114-slides17-public... · MAS114: Lecture 17 James Cranch http ... An early Christmas present

Squaring mod p

We worked with the factorial in the proof of Fermat’s LittleTheorem without ever needing to calculate it. It turns out we cancalculate it, using a clever trick.However, we’ll need a fact first:

Proposition

Let p be a prime, and let a be an integer with the property thata2 ” 1 pmod pq. Then either a ” 1 pmod pq or a ” ´1 pmod pq.

Proof.If a2 ” 1 pmod pq, then a2 ´ 1 ” 0 pmod pq, ie pa´ 1qpa` 1q ” 0pmod pq. In other words, p | pa´ 1qpa` 1q.But then, either p | a´ 1 (in which case a ” 1 pmod pq), orp | a` 1 (in which case a ” ´1 pmod pq).

Page 24: MAS114: Lecture 17 - University of Sheffieldcranch.staff.shef.ac.uk/mas114/docs/slides/mas114-slides17-public... · MAS114: Lecture 17 James Cranch http ... An early Christmas present

Squaring mod p

We worked with the factorial in the proof of Fermat’s LittleTheorem without ever needing to calculate it.

It turns out we cancalculate it, using a clever trick.However, we’ll need a fact first:

Proposition

Let p be a prime, and let a be an integer with the property thata2 ” 1 pmod pq. Then either a ” 1 pmod pq or a ” ´1 pmod pq.

Proof.If a2 ” 1 pmod pq, then a2 ´ 1 ” 0 pmod pq, ie pa´ 1qpa` 1q ” 0pmod pq. In other words, p | pa´ 1qpa` 1q.But then, either p | a´ 1 (in which case a ” 1 pmod pq), orp | a` 1 (in which case a ” ´1 pmod pq).

Page 25: MAS114: Lecture 17 - University of Sheffieldcranch.staff.shef.ac.uk/mas114/docs/slides/mas114-slides17-public... · MAS114: Lecture 17 James Cranch http ... An early Christmas present

Squaring mod p

We worked with the factorial in the proof of Fermat’s LittleTheorem without ever needing to calculate it. It turns out we cancalculate it, using a clever trick.

However, we’ll need a fact first:

Proposition

Let p be a prime, and let a be an integer with the property thata2 ” 1 pmod pq. Then either a ” 1 pmod pq or a ” ´1 pmod pq.

Proof.If a2 ” 1 pmod pq, then a2 ´ 1 ” 0 pmod pq, ie pa´ 1qpa` 1q ” 0pmod pq. In other words, p | pa´ 1qpa` 1q.But then, either p | a´ 1 (in which case a ” 1 pmod pq), orp | a` 1 (in which case a ” ´1 pmod pq).

Page 26: MAS114: Lecture 17 - University of Sheffieldcranch.staff.shef.ac.uk/mas114/docs/slides/mas114-slides17-public... · MAS114: Lecture 17 James Cranch http ... An early Christmas present

Squaring mod p

We worked with the factorial in the proof of Fermat’s LittleTheorem without ever needing to calculate it. It turns out we cancalculate it, using a clever trick.However, we’ll need a fact first:

Proposition

Let p be a prime, and let a be an integer with the property thata2 ” 1 pmod pq. Then either a ” 1 pmod pq or a ” ´1 pmod pq.

Proof.If a2 ” 1 pmod pq, then a2 ´ 1 ” 0 pmod pq, ie pa´ 1qpa` 1q ” 0pmod pq. In other words, p | pa´ 1qpa` 1q.But then, either p | a´ 1 (in which case a ” 1 pmod pq), orp | a` 1 (in which case a ” ´1 pmod pq).

Page 27: MAS114: Lecture 17 - University of Sheffieldcranch.staff.shef.ac.uk/mas114/docs/slides/mas114-slides17-public... · MAS114: Lecture 17 James Cranch http ... An early Christmas present

Squaring mod p

We worked with the factorial in the proof of Fermat’s LittleTheorem without ever needing to calculate it. It turns out we cancalculate it, using a clever trick.However, we’ll need a fact first:

Proposition

Let p be a prime, and let a be an integer with the property thata2 ” 1 pmod pq. Then either a ” 1 pmod pq or a ” ´1 pmod pq.

Proof.If a2 ” 1 pmod pq, then a2 ´ 1 ” 0 pmod pq, ie pa´ 1qpa` 1q ” 0pmod pq. In other words, p | pa´ 1qpa` 1q.But then, either p | a´ 1 (in which case a ” 1 pmod pq), orp | a` 1 (in which case a ” ´1 pmod pq).

Page 28: MAS114: Lecture 17 - University of Sheffieldcranch.staff.shef.ac.uk/mas114/docs/slides/mas114-slides17-public... · MAS114: Lecture 17 James Cranch http ... An early Christmas present

Squaring mod p

We worked with the factorial in the proof of Fermat’s LittleTheorem without ever needing to calculate it. It turns out we cancalculate it, using a clever trick.However, we’ll need a fact first:

Proposition

Let p be a prime, and let a be an integer with the property thata2 ” 1 pmod pq. Then either a ” 1 pmod pq or a ” ´1 pmod pq.

Proof.If a2 ” 1 pmod pq, then a2 ´ 1 ” 0 pmod pq

, ie pa´ 1qpa` 1q ” 0pmod pq. In other words, p | pa´ 1qpa` 1q.But then, either p | a´ 1 (in which case a ” 1 pmod pq), orp | a` 1 (in which case a ” ´1 pmod pq).

Page 29: MAS114: Lecture 17 - University of Sheffieldcranch.staff.shef.ac.uk/mas114/docs/slides/mas114-slides17-public... · MAS114: Lecture 17 James Cranch http ... An early Christmas present

Squaring mod p

We worked with the factorial in the proof of Fermat’s LittleTheorem without ever needing to calculate it. It turns out we cancalculate it, using a clever trick.However, we’ll need a fact first:

Proposition

Let p be a prime, and let a be an integer with the property thata2 ” 1 pmod pq. Then either a ” 1 pmod pq or a ” ´1 pmod pq.

Proof.If a2 ” 1 pmod pq, then a2 ´ 1 ” 0 pmod pq, ie pa´ 1qpa` 1q ” 0pmod pq.

In other words, p | pa´ 1qpa` 1q.But then, either p | a´ 1 (in which case a ” 1 pmod pq), orp | a` 1 (in which case a ” ´1 pmod pq).

Page 30: MAS114: Lecture 17 - University of Sheffieldcranch.staff.shef.ac.uk/mas114/docs/slides/mas114-slides17-public... · MAS114: Lecture 17 James Cranch http ... An early Christmas present

Squaring mod p

We worked with the factorial in the proof of Fermat’s LittleTheorem without ever needing to calculate it. It turns out we cancalculate it, using a clever trick.However, we’ll need a fact first:

Proposition

Let p be a prime, and let a be an integer with the property thata2 ” 1 pmod pq. Then either a ” 1 pmod pq or a ” ´1 pmod pq.

Proof.If a2 ” 1 pmod pq, then a2 ´ 1 ” 0 pmod pq, ie pa´ 1qpa` 1q ” 0pmod pq. In other words, p | pa´ 1qpa` 1q.

But then, either p | a´ 1 (in which case a ” 1 pmod pq), orp | a` 1 (in which case a ” ´1 pmod pq).

Page 31: MAS114: Lecture 17 - University of Sheffieldcranch.staff.shef.ac.uk/mas114/docs/slides/mas114-slides17-public... · MAS114: Lecture 17 James Cranch http ... An early Christmas present

Squaring mod p

We worked with the factorial in the proof of Fermat’s LittleTheorem without ever needing to calculate it. It turns out we cancalculate it, using a clever trick.However, we’ll need a fact first:

Proposition

Let p be a prime, and let a be an integer with the property thata2 ” 1 pmod pq. Then either a ” 1 pmod pq or a ” ´1 pmod pq.

Proof.If a2 ” 1 pmod pq, then a2 ´ 1 ” 0 pmod pq, ie pa´ 1qpa` 1q ” 0pmod pq. In other words, p | pa´ 1qpa` 1q.But then, either p | a´ 1

(in which case a ” 1 pmod pq), orp | a` 1 (in which case a ” ´1 pmod pq).

Page 32: MAS114: Lecture 17 - University of Sheffieldcranch.staff.shef.ac.uk/mas114/docs/slides/mas114-slides17-public... · MAS114: Lecture 17 James Cranch http ... An early Christmas present

Squaring mod p

We worked with the factorial in the proof of Fermat’s LittleTheorem without ever needing to calculate it. It turns out we cancalculate it, using a clever trick.However, we’ll need a fact first:

Proposition

Let p be a prime, and let a be an integer with the property thata2 ” 1 pmod pq. Then either a ” 1 pmod pq or a ” ´1 pmod pq.

Proof.If a2 ” 1 pmod pq, then a2 ´ 1 ” 0 pmod pq, ie pa´ 1qpa` 1q ” 0pmod pq. In other words, p | pa´ 1qpa` 1q.But then, either p | a´ 1 (in which case a ” 1 pmod pq)

, orp | a` 1 (in which case a ” ´1 pmod pq).

Page 33: MAS114: Lecture 17 - University of Sheffieldcranch.staff.shef.ac.uk/mas114/docs/slides/mas114-slides17-public... · MAS114: Lecture 17 James Cranch http ... An early Christmas present

Squaring mod p

We worked with the factorial in the proof of Fermat’s LittleTheorem without ever needing to calculate it. It turns out we cancalculate it, using a clever trick.However, we’ll need a fact first:

Proposition

Let p be a prime, and let a be an integer with the property thata2 ” 1 pmod pq. Then either a ” 1 pmod pq or a ” ´1 pmod pq.

Proof.If a2 ” 1 pmod pq, then a2 ´ 1 ” 0 pmod pq, ie pa´ 1qpa` 1q ” 0pmod pq. In other words, p | pa´ 1qpa` 1q.But then, either p | a´ 1 (in which case a ” 1 pmod pq), orp | a` 1

(in which case a ” ´1 pmod pq).

Page 34: MAS114: Lecture 17 - University of Sheffieldcranch.staff.shef.ac.uk/mas114/docs/slides/mas114-slides17-public... · MAS114: Lecture 17 James Cranch http ... An early Christmas present

Squaring mod p

We worked with the factorial in the proof of Fermat’s LittleTheorem without ever needing to calculate it. It turns out we cancalculate it, using a clever trick.However, we’ll need a fact first:

Proposition

Let p be a prime, and let a be an integer with the property thata2 ” 1 pmod pq. Then either a ” 1 pmod pq or a ” ´1 pmod pq.

Proof.If a2 ” 1 pmod pq, then a2 ´ 1 ” 0 pmod pq, ie pa´ 1qpa` 1q ” 0pmod pq. In other words, p | pa´ 1qpa` 1q.But then, either p | a´ 1 (in which case a ” 1 pmod pq), orp | a` 1 (in which case a ” ´1 pmod pq).

Page 35: MAS114: Lecture 17 - University of Sheffieldcranch.staff.shef.ac.uk/mas114/docs/slides/mas114-slides17-public... · MAS114: Lecture 17 James Cranch http ... An early Christmas present

A comment

RemarkThis theorem is not true for some composite moduli! For example,12 ” 32 ” 52 ” 72 ” 1 pmod 8q.I regard this as more evidence that prime moduli behave verynicely indeed!

Page 36: MAS114: Lecture 17 - University of Sheffieldcranch.staff.shef.ac.uk/mas114/docs/slides/mas114-slides17-public... · MAS114: Lecture 17 James Cranch http ... An early Christmas present

A comment

RemarkThis theorem is not true for some composite moduli!

For example,12 ” 32 ” 52 ” 72 ” 1 pmod 8q.I regard this as more evidence that prime moduli behave verynicely indeed!

Page 37: MAS114: Lecture 17 - University of Sheffieldcranch.staff.shef.ac.uk/mas114/docs/slides/mas114-slides17-public... · MAS114: Lecture 17 James Cranch http ... An early Christmas present

A comment

RemarkThis theorem is not true for some composite moduli! For example,12 ” 32 ” 52 ” 72 ” 1 pmod 8q.

I regard this as more evidence that prime moduli behave verynicely indeed!

Page 38: MAS114: Lecture 17 - University of Sheffieldcranch.staff.shef.ac.uk/mas114/docs/slides/mas114-slides17-public... · MAS114: Lecture 17 James Cranch http ... An early Christmas present

A comment

RemarkThis theorem is not true for some composite moduli! For example,12 ” 32 ” 52 ” 72 ” 1 pmod 8q.I regard this as more evidence that prime moduli behave verynicely indeed!

Page 39: MAS114: Lecture 17 - University of Sheffieldcranch.staff.shef.ac.uk/mas114/docs/slides/mas114-slides17-public... · MAS114: Lecture 17 James Cranch http ... An early Christmas present

Wilson’s Theorem

Now, this allows us to do this:

Theorem (Wilson’s Theorem)

We have pn ´ 1q! ” ´1 pmod nq if and only if n is prime.

Proof.

?

Page 40: MAS114: Lecture 17 - University of Sheffieldcranch.staff.shef.ac.uk/mas114/docs/slides/mas114-slides17-public... · MAS114: Lecture 17 James Cranch http ... An early Christmas present

Wilson’s Theorem

Now, this allows us to do this:

Theorem (Wilson’s Theorem)

We have pn ´ 1q! ” ´1 pmod nq if and only if n is prime.

Proof.

?

Page 41: MAS114: Lecture 17 - University of Sheffieldcranch.staff.shef.ac.uk/mas114/docs/slides/mas114-slides17-public... · MAS114: Lecture 17 James Cranch http ... An early Christmas present

Wilson’s Theorem

Now, this allows us to do this:

Theorem (Wilson’s Theorem)

We have pn ´ 1q! ” ´1 pmod nq if and only if n is prime.

Proof.

?

Page 42: MAS114: Lecture 17 - University of Sheffieldcranch.staff.shef.ac.uk/mas114/docs/slides/mas114-slides17-public... · MAS114: Lecture 17 James Cranch http ... An early Christmas present

Wilson’s Theorem

Now, this allows us to do this:

Theorem (Wilson’s Theorem)

We have pn ´ 1q! ” ´1 pmod nq if and only if n is prime.

Proof.

?

Page 43: MAS114: Lecture 17 - University of Sheffieldcranch.staff.shef.ac.uk/mas114/docs/slides/mas114-slides17-public... · MAS114: Lecture 17 James Cranch http ... An early Christmas present

Examples and remarks

Here’s an example or two:

§ 4 is composite, and p4´ 1q! “ 3! “ 6 ” 2 pmod 4q.

§ 5 is prime, and p5´ 1q! “ 4! “ 24 ” ´1 pmod 5q.

§ 6 is composite, and p6´ 1q! “ 5! “ 120 ” 0 pmod 6q.

§ 7 is prime, and p7´ 1q! “ 6! “ 720 ” ´1 pmod 7q.

RemarkYou could use this as a way of testing if a number is prime.As a matter of fact, it’s not a good way of doing it: if we want tocheck a large number N, it’s quicker to do trial division to see if Nhas any factors, than it is to multiply lots of numbers together.But this result was psychologically important in the developmentof modern fast primality tests: it was the first evidence that thereare ways of investigating whether a number N is prime or not bylooking at how arithmetic modulo N behaves.

Page 44: MAS114: Lecture 17 - University of Sheffieldcranch.staff.shef.ac.uk/mas114/docs/slides/mas114-slides17-public... · MAS114: Lecture 17 James Cranch http ... An early Christmas present

Examples and remarks

Here’s an example or two:

§ 4 is composite, and p4´ 1q! “ 3! “ 6 ” 2 pmod 4q.

§ 5 is prime, and p5´ 1q! “ 4! “ 24 ” ´1 pmod 5q.

§ 6 is composite, and p6´ 1q! “ 5! “ 120 ” 0 pmod 6q.

§ 7 is prime, and p7´ 1q! “ 6! “ 720 ” ´1 pmod 7q.

RemarkYou could use this as a way of testing if a number is prime.As a matter of fact, it’s not a good way of doing it: if we want tocheck a large number N, it’s quicker to do trial division to see if Nhas any factors, than it is to multiply lots of numbers together.But this result was psychologically important in the developmentof modern fast primality tests: it was the first evidence that thereare ways of investigating whether a number N is prime or not bylooking at how arithmetic modulo N behaves.

Page 45: MAS114: Lecture 17 - University of Sheffieldcranch.staff.shef.ac.uk/mas114/docs/slides/mas114-slides17-public... · MAS114: Lecture 17 James Cranch http ... An early Christmas present

Examples and remarks

Here’s an example or two:

§ 4 is composite, and p4´ 1q! “ 3! “ 6 ” 2 pmod 4q.

§ 5 is prime, and p5´ 1q! “ 4! “ 24 ” ´1 pmod 5q.

§ 6 is composite, and p6´ 1q! “ 5! “ 120 ” 0 pmod 6q.

§ 7 is prime, and p7´ 1q! “ 6! “ 720 ” ´1 pmod 7q.

RemarkYou could use this as a way of testing if a number is prime.As a matter of fact, it’s not a good way of doing it: if we want tocheck a large number N, it’s quicker to do trial division to see if Nhas any factors, than it is to multiply lots of numbers together.But this result was psychologically important in the developmentof modern fast primality tests: it was the first evidence that thereare ways of investigating whether a number N is prime or not bylooking at how arithmetic modulo N behaves.

Page 46: MAS114: Lecture 17 - University of Sheffieldcranch.staff.shef.ac.uk/mas114/docs/slides/mas114-slides17-public... · MAS114: Lecture 17 James Cranch http ... An early Christmas present

Examples and remarks

Here’s an example or two:

§ 4 is composite, and p4´ 1q! “ 3! “ 6 ” 2 pmod 4q.

§ 5 is prime, and p5´ 1q! “ 4! “ 24 ” ´1 pmod 5q.

§ 6 is composite, and p6´ 1q! “ 5! “ 120 ” 0 pmod 6q.

§ 7 is prime, and p7´ 1q! “ 6! “ 720 ” ´1 pmod 7q.

RemarkYou could use this as a way of testing if a number is prime.As a matter of fact, it’s not a good way of doing it: if we want tocheck a large number N, it’s quicker to do trial division to see if Nhas any factors, than it is to multiply lots of numbers together.But this result was psychologically important in the developmentof modern fast primality tests: it was the first evidence that thereare ways of investigating whether a number N is prime or not bylooking at how arithmetic modulo N behaves.

Page 47: MAS114: Lecture 17 - University of Sheffieldcranch.staff.shef.ac.uk/mas114/docs/slides/mas114-slides17-public... · MAS114: Lecture 17 James Cranch http ... An early Christmas present

Examples and remarks

Here’s an example or two:

§ 4 is composite, and p4´ 1q! “ 3! “ 6 ” 2 pmod 4q.

§ 5 is prime, and p5´ 1q! “ 4! “ 24 ” ´1 pmod 5q.

§ 6 is composite, and p6´ 1q! “ 5! “ 120 ” 0 pmod 6q.

§ 7 is prime, and p7´ 1q! “ 6! “ 720 ” ´1 pmod 7q.

RemarkYou could use this as a way of testing if a number is prime.As a matter of fact, it’s not a good way of doing it: if we want tocheck a large number N, it’s quicker to do trial division to see if Nhas any factors, than it is to multiply lots of numbers together.But this result was psychologically important in the developmentof modern fast primality tests: it was the first evidence that thereare ways of investigating whether a number N is prime or not bylooking at how arithmetic modulo N behaves.

Page 48: MAS114: Lecture 17 - University of Sheffieldcranch.staff.shef.ac.uk/mas114/docs/slides/mas114-slides17-public... · MAS114: Lecture 17 James Cranch http ... An early Christmas present

Examples and remarks

Here’s an example or two:

§ 4 is composite, and p4´ 1q! “ 3! “ 6 ” 2 pmod 4q.

§ 5 is prime, and p5´ 1q! “ 4! “ 24 ” ´1 pmod 5q.

§ 6 is composite, and p6´ 1q! “ 5! “ 120 ” 0 pmod 6q.

§ 7 is prime, and p7´ 1q! “ 6! “ 720 ” ´1 pmod 7q.

RemarkYou could use this as a way of testing if a number is prime.As a matter of fact, it’s not a good way of doing it: if we want tocheck a large number N, it’s quicker to do trial division to see if Nhas any factors, than it is to multiply lots of numbers together.But this result was psychologically important in the developmentof modern fast primality tests: it was the first evidence that thereare ways of investigating whether a number N is prime or not bylooking at how arithmetic modulo N behaves.

Page 49: MAS114: Lecture 17 - University of Sheffieldcranch.staff.shef.ac.uk/mas114/docs/slides/mas114-slides17-public... · MAS114: Lecture 17 James Cranch http ... An early Christmas present

Examples and remarks

Here’s an example or two:

§ 4 is composite, and p4´ 1q! “ 3! “ 6 ” 2 pmod 4q.

§ 5 is prime, and p5´ 1q! “ 4! “ 24 ” ´1 pmod 5q.

§ 6 is composite, and p6´ 1q! “ 5! “ 120 ” 0 pmod 6q.

§ 7 is prime, and p7´ 1q! “ 6! “ 720 ” ´1 pmod 7q.

RemarkYou could use this as a way of testing if a number is prime.

As a matter of fact, it’s not a good way of doing it: if we want tocheck a large number N, it’s quicker to do trial division to see if Nhas any factors, than it is to multiply lots of numbers together.But this result was psychologically important in the developmentof modern fast primality tests: it was the first evidence that thereare ways of investigating whether a number N is prime or not bylooking at how arithmetic modulo N behaves.

Page 50: MAS114: Lecture 17 - University of Sheffieldcranch.staff.shef.ac.uk/mas114/docs/slides/mas114-slides17-public... · MAS114: Lecture 17 James Cranch http ... An early Christmas present

Examples and remarks

Here’s an example or two:

§ 4 is composite, and p4´ 1q! “ 3! “ 6 ” 2 pmod 4q.

§ 5 is prime, and p5´ 1q! “ 4! “ 24 ” ´1 pmod 5q.

§ 6 is composite, and p6´ 1q! “ 5! “ 120 ” 0 pmod 6q.

§ 7 is prime, and p7´ 1q! “ 6! “ 720 ” ´1 pmod 7q.

RemarkYou could use this as a way of testing if a number is prime.As a matter of fact, it’s not a good way of doing it: if we want tocheck a large number N, it’s quicker to do trial division to see if Nhas any factors, than it is to multiply lots of numbers together.

But this result was psychologically important in the developmentof modern fast primality tests: it was the first evidence that thereare ways of investigating whether a number N is prime or not bylooking at how arithmetic modulo N behaves.

Page 51: MAS114: Lecture 17 - University of Sheffieldcranch.staff.shef.ac.uk/mas114/docs/slides/mas114-slides17-public... · MAS114: Lecture 17 James Cranch http ... An early Christmas present

Examples and remarks

Here’s an example or two:

§ 4 is composite, and p4´ 1q! “ 3! “ 6 ” 2 pmod 4q.

§ 5 is prime, and p5´ 1q! “ 4! “ 24 ” ´1 pmod 5q.

§ 6 is composite, and p6´ 1q! “ 5! “ 120 ” 0 pmod 6q.

§ 7 is prime, and p7´ 1q! “ 6! “ 720 ” ´1 pmod 7q.

RemarkYou could use this as a way of testing if a number is prime.As a matter of fact, it’s not a good way of doing it: if we want tocheck a large number N, it’s quicker to do trial division to see if Nhas any factors, than it is to multiply lots of numbers together.But this result was psychologically important in the developmentof modern fast primality tests: it was the first evidence that thereare ways of investigating whether a number N is prime or not bylooking at how arithmetic modulo N behaves.