aarjaneiro/planetmath huggingface dataset:
examples of the Lucas-Lehmer primality test on small numbers

examples of the Lucas-Lehmer primality test on small numbers

To illustrate the

Lucas-Lehmer primality test

for

Mersenne numbers

, it is best to use small numbers. For any purpose other than pedagogical, applying this test to a small number is of course more trouble than it’s worth, since it would be much easier to just perform

integer factorization

; a classic example of “sandblasting a soup cracker,” in Scott Adams’ words. But for the purpose of illustrating the test, since the numbers in the

recurrence relation

get quite large, small numbers are more suitable.

Is

M

3

=

2

3

-

1

=

7

a

Mersenne prime

? The first few terms of the recurrence relation

s

n

=

s

n

-

1

2

-

2

(with initial term

s

1

=

4

) are 4, 14, 194, 37634, 1416317954, 2005956546822746114, 4023861667741036022825635656102100994, etc. (see A003010 in Sloane’s OEIS). For our first example, we need to look up

s

3

-

1

, which is 14. That number divided by 7 is 2, telling us that 7 is indeed a Mersenne prime.

Is

M

7

=

2

7

-

1

=

127

a Mersenne prime?

s

6

=

2005956546822746114

and that divides neatly by 127, being 15794933439549182 times 127. So 127 is indeed a Mersenne prime. Already this is larger than what a typical pocket

scientific calculator

can handle with

integer

precision

.

What about 11?

s

10

is 687296824066442772388374862317475309242471541086466717521926185830884874057909
579647328830691025610434367796639355951720423573065949163446060745647128680782
876080552030246583594390175808839109786661858757174155410844949265004751673811
68505927378181899753839260609452265365274850901879881203714, which divided by 2047 gives a

remainder

of 1736, telling us that 2047 is a Mersenne number but not a Mersenne prime. Even by

computer

it would have been quicker to perform

trial division

on 2047, giving the result

2047

=

23

×

89

. But already for

M

59

, with its least

prime factor

being 179951, the 16336th prime, the

Lucas-Lehmer test

appears much more attractive than trial division.

How does the test work on a

composite number

, say 4? Seeing that

s

3

=

194

≡

14

mod

15

(or

-

1

mod

15

if you prefer), it is quite

obvious

that 15 is not a Mersenne prime.

Title

examples of the Lucas-Lehmer primality test on small numbers

Canonical

name

ExamplesOfTheLucasLehmerPrimalityTestOnSmallNumbers

Date of creation

2013-03-22 17:45:40

Last modified on

2013-03-22 17:45:40

Owner

PrimeFan (13766)

Last modified by

PrimeFan (13766)

Numerical id

5

Author

PrimeFan (13766)

Entry type

Example

Classification

msc 11A51

Generated on Fri Feb 9 15:19:56 2018 by

LaTeXML
factorizations of n! for 1<n<50

factorizations of

n

!

for

1

<

n

<

50

The following table gives the exponent for each of the primes from 2 to 47 in the

prime factorization

of

n

!

. Stripping off the zeroes and ignoring the top row and the leftmost column, this table is A115627 in Sloane’s OEIS.

n

2

3

5

7

11

13

17

19

23

29

31

37

41

43

47

2

1

0

0

0

0

0

0

0

0

0

0

0

0

0

0

3

1

1

0

0

0

0

0

0

0

0

0

0

0

0

0

4

3

1

0

0

0

0

0

0

0

0

0

0

0

0

0

5

3

1

1

0

0

0

0

0

0

0

0

0

0

0

0

6

4

2

1

0

0

0

0

0

0

0

0

0

0

0

0

7

4

2

1

1

0

0

0

0

0

0

0

0

0

0

0

8

7

2

1

1

0

0

0

0

0

0

0

0

0

0

0

9

7

4

1

1

0

0

0

0

0

0

0

0

0

0

0

10

8

4

2

1

0

0

0

0

0

0

0

0

0

0

0

11

8

4

2

1

1

0

0

0

0

0

0

0

0

0

0

12

10

5

2

1

1

0

0

0

0

0

0

0

0

0

0

13

10

5

2

1

1

1

0

0

0

0

0

0

0

0

0

14

11

5

2

2

1

1

0

0

0

0

0

0

0

0

0

15

11

6

3

2

1

1

0

0

0

0

0

0

0

0

0

16

15

6

3

2

1

1

0

0

0

0

0

0

0

0

0

17

15

6

3

2

1

1

1

0

0

0

0

0

0

0

0

18

16

8

3

2

1

1

1

0

0

0

0

0

0

0

0

19

16

8

3

2

1

1

1

1

0

0

0

0

0

0

0

20

18

8

4

2

1

1

1

1

0

0

0

0

0

0

0

21

18

9

4

3

1

1

1

1

0

0

0

0

0

0

0

22

19

9

4

3

2

1

1

1

0

0

0

0

0

0

0

23

19

9

4

3

2

1

1

1

1

0

0

0

0

0

0

24

22

10

4

3

2

1

1

1

1

0

0

0

0

0

0

25

22

10

6

3

2

1

1

1

1

0

0

0

0

0

0

26

23

10

6

3

2

2

1

1

1

0

0

0

0

0

0

27

23

13

6

3

2

2

1

1

1

0

0

0

0

0

0

28

25

13

6

4

2

2

1

1

1

0

0

0

0

0

0

29

25

13

6

4

2

2

1

1

1

1

0

0

0

0

0

30

26

14

7

4

2

2

1

1

1

1

0

0

0

0

0

31

26

14

7

4

2

2

1

1

1

1

1

0

0

0

0

32

31

14

7

4

2

2

1

1

1

1

1

0

0

0

0

33

31

15

7

4

3

2

1

1

1

1

1

0

0

0

0

34

32

15

7

4

3

2

2

1

1

1

1

0

0

0

0

35

32

15

8

5

3

2

2

1

1

1

1

0

0

0

0

36

34

17

8

5

3

2

2

1

1

1

1

0

0

0

0

37

34

17

8

5

3

2

2

1

1

1

1

1

0

0

0

38

35

17

8

5

3

2

2

2

1

1

1

1

0

0

0

39

35

18

8

5

3

3

2

2

1

1

1

1

0

0

0

40

38

18

9

5

3

3

2

2

1

1

1

1

0

0

0

41

38

18

9

5

3

3

2

2

1

1

1

1

1

0

0

42

39

19

9

6

3

3

2

2

1

1

1

1

1

0

0

43

39

19

9

6

3

3

2

2

1

1

1

1

1

1

0

44

41

19

9

6

4

3

2

2

1

1

1

1

1

1

0

45

41

21

10

6

4

3

2

2

1

1

1

1

1

1

0

46

42

21

10

6

4

3

2

2

2

1

1

1

1

1

0

47

42

21

10

6

4

3

2

2

2

1

1

1

1

1

1

48

46

22

10

6

4

3

2

2

2

1

1

1

1

1

1

49

46

22

10

8

4

3

2

2

2

1

1

1

1

1

1

Title

factorizations of

n

!

for

1

<

n

<

50

Canonical name

FactorizationsOfNFor1N50

Date of creation

2013-03-22 18:01:14

Last modified on

2013-03-22 18:01:14

Owner

PrimeFan (13766)

Last modified by

PrimeFan (13766)

Numerical id

4

Author

PrimeFan (13766)

Entry type

Example

Classification

msc 11A51

Generated on Fri Feb 9 15:19:59 2018 by

LaTeXML
Fermat compositeness test

Fermat compositeness test

The

Fermat compositeness test

is a

primality test

based on the observation that by Fermat’s little theorem if

b

n

-

1

≢

1

(

mod

n

)

and

b

≢

0

(

mod

n

)

, then

n

is

composite

. The Fermat compositeness test consists of checking whether

b

n

-

1

≡

1

(

mod

n

)

for a handful of values of

b

. If a

b

with

b

n

-

1

≢

1

(

mod

n

)

is found, then

n

is composite.

A value of

b

for which

b

n

-

1

≢

1

(

mod

n

)

is called a

witness

to

n

’s compositeness. If

b

n

-

1

≡

1

(

mod

n

)

, then

n

is said to be

pseudoprime

base

b

.

It can be proven that most

composite numbers

can be shown to be composite by testing only a few values of

b

. However, there are infinitely many composite numbers that are pseudoprime in every base. These are

Carmichael numbers

(see OEIS

sequence

http://www.research.att.com/cgi-bin/access.cgi/as/njas/sequences/eisA.cgi?Anum=A002997

A002997 for a list of first few Carmichael numbers).

Title

Fermat compositeness test

Canonical name

FermatCompositenessTest

Date of creation

2013-03-22 13:17:36

Last modified on

2013-03-22 13:17:36

Owner

bbukh (348)

Last modified by

bbukh (348)

Numerical id

15

Author

bbukh (348)

Entry type

Algorithm

Classification

msc 11A51

Related topic

MillerRabinPrimeTest

Defines

pseudoprime

Defines

witness

Defines

Carmichael numbers

Generated on Fri Feb 9 15:20:01 2018 by

LaTeXML
Fermat numbers are coprime

Fermat numbers are coprime

Theorem

.

Any two

Fermat numbers are coprime

.

Proof.

Let

F

m

and

F

n

two

Fermat numbers

, and assume

m

<

n

.
Let

d

a

positive

common

divisor

of

F

n

and

F

m

, that is

d

∣

F

m

,

d

∣

F

n

.

If

d

∣

F

m

then

d

∣

F

1

F

2

⋯

F

n

-

1

since some factor must be

F

m

itself.
But

F

n

-

F

1

⁢

F

2

⁢

⋯

⁢

F

n

-

1

=

2

and so

d

∣

2

.
Since

d

is odd, we must have

d

=

1

.

Therefore, the

greatest common divisor

of any two Fermat numbers must be

1

.

Q.E.D.

Title

Fermat numbers are coprime

Canonical name

FermatNumbersAreCoprime

Date of creation

2013-03-22 14:51:24

Last modified on

2013-03-22 14:51:24

Owner

yark (2760)

Last modified by

yark (2760)

Numerical id

5

Author

yark (2760)

Entry type

Theorem

Classification

msc 11A51

Generated on Fri Feb 9 15:20:02 2018 by

LaTeXML
Fermat quotient

Fermat quotient

If

a

is an

integer

not

divisible

by a

positive

prime

p

, then Fermat’s little

theorem

(a.k.a. Fermat’s theorem) guarantees that the

difference

a

p

-

1

-

1

is divisible by

p

.  The integer

q

p

⁢

(

a

)

:=

a

p

-

1

-

1

p

is called the

Fermat quotient

of

a

modulo

p

.  Compare it with the

Wilson quotient

w

p

, which is similarly related to Wilson’s theorem.

Lerch’s

formula

∑

a

=

1

p

-

1

q

p

⁢

(

a

)

≡

w

p

(

mod

p

)

for an

odd prime

p

connects the Fermat quotients and the Wilson quotient.

If

p

is a positive prime but not a

Wilson prime

, and

w

p

is its Wilson quotient, then the expression

q

p

⁢

(

w

p

)

=

w

p

p

-

1

-

1

p

is called the

Fermat–Wilson quotient

of

p

.  Sondow proves in [1] that the

greatest common divisor

of all Fermat–Wilson quotients is 24.

References

1

Jonathan Sondow

:

Lerch Quotients, Lerch Primes,
Fermat–Wilson Quotients, and the Wieferich-non-Wilson Primes 2, 3, 14771

. Available at

http://arxiv.org/pdf/1110.3113v3.pdf

arXiv.

Title

Fermat quotient

Canonical name

FermatQuotient

Date of creation

2013-03-22 19:34:22

Last modified on

2013-03-22 19:34:22

Owner

pahio (2872)

Last modified by

pahio (2872)

Numerical id

12

Author

pahio (2872)

Entry type

Definition

Classification

msc 11A51

Classification

msc 11A41

Defines

Lerch’s formula

Defines

Fermat–Wilson quotient

Generated on Fri Feb 9 15:20:04 2018 by

LaTeXML
interprime

interprime

Given two consecutive

odd primes

, the

i

th prime

p

i

and the next one,

p

i

+

1

, an

interprime

n

is the

arithmetic mean

of the two:

n

=

p

i

+

p

i

+

1

2

Thus,

n

-

p

i

=

p

i

+

1

-

n

, so alternatively

n

=

p

i

+

p

i

+

1

-

p

i

2

=

p

i

+

1

-

p

i

+

1

-

p

i

2

.

For example, given the 269th and 270th primes, 1723 and 1733, the interprime is 1728, and indeed

1728

-

1723

=

1733

-

1728

=

5

. Interprimes themselves are of course always

composite

, though not always even. An interprime between a

twin prime

will always be even, while an interprime between the second (ending in 3 in base 10) and third (ending in 7 in base 10) member of a

prime quadruplet

will always be odd and be

divisible

by 5.

The first few interprimes are 4, 6, 9, 12, 15, 18, 21, 26, 30, 34, 39, 42, 45, 50, 56, 60, 64, 69, 72, 76, 81, 86, 93, 99, etc., listed in A024675 of Sloane’s OEIS.

Title

interprime

Canonical name

Interprime

Date of creation

2013-03-22 18:08:25

Last modified on

2013-03-22 18:08:25

Owner

PrimeFan (13766)

Last modified by

PrimeFan (13766)

Numerical id

5

Author

PrimeFan (13766)

Entry type

Definition

Classification

msc 11A51

Related topic

MinimalAndMaximalNumber

Generated on Fri Feb 9 15:20:08 2018 by

LaTeXML
Knödel number

Knödel number

The

Knödel numbers

K

n

for a given

positive integer

n

are the set of

composite

integers

m

>

n

such that any

b

<

m

coprime

to

m

satisfies

b

m

-

n

≡

1

mod

m

. The

Carmichael numbers

are

K

1

. There are infinitely many

Knodel number

K

n

for a given

n

, something which was first proven only for

n

>

2

. Erdős speculated that this was also true for

n

=

1

but two decades passed before this was conclusively proved by Alford, Granville and Pomerance.

References

1

W. R. Alford, A. Granville, and C. Pomerance. “There are Infinitely Many Carmichael Numbers”

Annals of Mathematics

139

(1994): 703 - 722

2

P. Ribenboim,

The Little Book of Bigger Primes

, (2004), New York: Springer-Verlag, p. 102.

Title

Knödel number

Canonical name

KnodelNumber

Date of creation

2013-03-22 16:06:54

Last modified on

2013-03-22 16:06:54

Owner

PrimeFan (13766)

Last modified by

PrimeFan (13766)

Numerical id

6

Author

PrimeFan (13766)

Entry type

Definition

Classification

msc 11A51

Synonym

Knodel number

Generated on Fri Feb 9 15:20:10 2018 by

LaTeXML
least prime factor

least prime factor

The

least

prime factor

of a

positive integer

n

is the smallest

positive

prime number

dividing

n

. Sometimes expressed as a function,

lpf

⁢

(

n

)

. For example,

lpf

⁢

(

91

)

=

7

. For a prime number

p

, clearly

lpf

⁢

(

p

)

=

p

, while for any

composite number

(except squares of primes)

(

lpf

⁢

(

n

)

)

2

<

n

. (The function would be quite useless if 1 is considered a prime, therefore

lpf

⁢

(

1

)

is undefined — though we could make an argument for

lpf

⁢

(

0

)

=

2

). In the

sequence

of least prime factors for each

integer

in turn, each prime occurs first at the index for itself then not again until its square.

In Mathematica, one can use

LeastPrimeFactor[n]

after loading a

number theory

package, or much more simply by using the command

FactorInteger[n][[1,1]]

(of course substituting

n

as necessary).

Title

least prime factor

Canonical

name

LeastPrimeFactor

Date of creation

2013-03-22 17:40:03

Last modified on

2013-03-22 17:40:03

Owner

PrimeFan (13766)

Last modified by

PrimeFan (13766)

Numerical id

5

Author

PrimeFan (13766)

Entry type

Definition

Classification

msc 11A51

Generated on Fri Feb 9 15:20:11 2018 by

LaTeXML
Lucas-Carmichael number

Lucas-Carmichael number

Given an odd

squarefree

integer

n

(that is, one with factorization

n

=

∏

i

=

1

ω

⁢

(

n

)

p

i

, with

ω

⁢

(

n

)

being the

number of distinct prime factors function

, and all

p

i

>

2

) if it the case that each

p

i

+

1

is a

divisor

of

n

+

1

, then

n

is called a

Lucas-Carmichael number

.

For example, 935 has three

prime factors

, 5, 11, 17. Adding one to each of these we get 6, 12, 18, and these three numbers are all divisors of 936. Therefore, 935 is a Lucas-Carmichael number.

The first few Lucas-Carmichael numbers are 399, 935, 2015, 2915, 4991, 5719, 7055, 8855. These are listed in A006972 of Sloane’s OEIS.

Not to be confused with

Carmichael numbers

, the absolute Fermat

pseudoprimes

.

Title

Lucas-Carmichael number

Canonical name

LucasCarmichaelNumber

Date of creation

2013-03-22 17:41:14

Last modified on

2013-03-22 17:41:14

Owner

PrimeFan (13766)

Last modified by

PrimeFan (13766)

Numerical id

6

Author

PrimeFan (13766)

Entry type

Definition

Classification

msc 11A51

Generated on Fri Feb 9 15:20:13 2018 by

LaTeXML
Lucas-Lehmer primality test

Lucas-Lehmer primality test

Theorem

:

Let

p

>

2

be a prime, and let

M

p

be a

Mersenne number

, then

M

p

is prime iff

M

p

divides

s

p

-

1

where the numbers

(

s

n

)

n

≥

1

are given by the following

recurrence relation

:

s

1

=

4

, and

s

n

+

1

=

s

n

2

-

2

for

n

≥

1

.

Title

Lucas-Lehmer primality test

Canonical name

LucasLehmerPrimalityTest

Date of creation

2013-03-22 14:24:31

Last modified on

2013-03-22 14:24:31

Owner

CWoo (3771)

Last modified by

CWoo (3771)

Numerical id

8

Author

CWoo (3771)

Entry type

Theorem

Classification

msc 11A51

Generated on Fri Feb 9 15:20:15 2018 by

LaTeXML
n-free number

n

-free number

The

concept

of a

squarefree

number can be generalized. Let

n

∈

ℤ

with

n

>

1

. Then

m

∈

ℤ

is

n

-free

if, for any prime

p

,

p

n

does not divide

m

.

Let

S

denote the set of all squarefree

natural numbers

. Note that, for any

n

and any

positive

n

-free

integer

m

, there exists a unique

(

a

1

,

…

,

a

n

-

1

)

∈

S

n

-

1

with

gcd

⁡

(

a

i

,

a

j

)

=

1

for

i

≠

j

such that

m

=

∏

j

=

1

n

-

1

a

j

j

.

Title

n

-free number

Canonical name

NfreeNumber

Date of creation

2013-03-22 16:02:22

Last modified on

2013-03-22 16:02:22

Owner

Wkbj79 (1863)

Last modified by

Wkbj79 (1863)

Numerical id

6

Author

Wkbj79 (1863)

Entry type

Definition

Classification

msc 11A51

Related topic

SquareFreeNumber

Related topic

NFullNumber

Defines

cubefree

Defines

cubefree number

Defines

cube free

Defines

cube free number

Defines

cube-free

Defines

cube-free number

Generated on Fri Feb 9 15:20:17 2018 by

LaTeXML
n-full number

n

-full number

The concept of a

squarefull number

can be generalized. Let

n

∈

ℤ

with

n

>

1

. Then

m

∈

ℤ

is

n

-full

if, for every prime

p

dividing

m

,

p

n

divides

m

.

Note that

m

is

n

-full if and only if there exist

a

0

,

…

,

a

n

-

1

∈

ℤ

such that

m

=

∏

j

=

0

n

-

1

a

j

n

+

j

.

Title

n

-full number

Canonical name

NfullNumber

Date of creation

2013-03-22 16:02:51

Last modified on

2013-03-22 16:02:51

Owner

Wkbj79 (1863)

Last modified by

Wkbj79 (1863)

Numerical id

6

Author

Wkbj79 (1863)

Entry type

Definition

Classification

msc 11A51

Related topic

SquarefullNumber

Related topic

NFreeNumber

Defines

cubefull

Defines

cubefull number

Defines

cube full

Defines

cube full number

Defines

cube-full

Defines

cube-full number

Generated on Fri Feb 9 15:20:19 2018 by

LaTeXML
odd number

odd number

An

odd number

n

is an

integer

of the form

2

⁢

m

+

1

, and as such it is not

divisible

by 2. In terms of

congruences

,

n

≡

1

mod

2

, and in its binary representation the least significant bit is 1. With the exception of 2, all

prime numbers

are odd numbers.

The

addition

of two odd numbers gives an

even number

, or any even number of odd summands gives an even number as a result. For example,

11

+

13

+

17

+

19

=

60

.

But the

multiplication

of two odd numbers, or any even amount of odd multiplicands always gives an odd number. For example,

11

×

13

×

17

×

19

=

46189

.

A

negative number

raised to the power of an odd number gives a negative number. For example,

(

-

1

)

11

=

(

-

1

)

13

=

(

-

1

)

17

=

(

-

1

)

19

=

-

1

(compare

(

-

1

)

10

=

(

-

1

)

12

=

(

-

1

)

16

=

(

-

1

)

18

=

1

).

The sum of the first

n

consecutive

positive

odd numbers is

n

2

.

The famous

Gregory series

which gives a quarter of

π

is an

alternating sum

of the

reciprocals

of the odd numbers:

π

4

=

∑

i

=

0

∞

(

-

1

)

i

⁢

1

2

⁢

i

+

1

=

1

-

1

3

+

1

5

-

1

7

+

1

9

-

…

However, note that this series is not

absolutely convergent

.

Title

odd number

Canonical

name

OddNumber

Date of creation

2013-03-22 17:42:30

Last modified on

2013-03-22 17:42:30

Owner

PrimeFan (13766)

Last modified by

PrimeFan (13766)

Numerical id

7

Author

PrimeFan (13766)

Entry type

Definition

Classification

msc 11A51

Related topic

EvenNumber

Related topic

SumOfOddNumbers

Generated on Fri Feb 9 15:20:20 2018 by

LaTeXML
Pépin’s theorem

Pépin’s theorem

Theorem

(Pépin). A

Fermat number

F

n

=

2

2

n

+

1

is prime only if

3

F

n

-

1

2

≡

-

1

mod

F

n

.

In other words, if 3 raised to the largest

power of two

not greater than the Fermat number leaves as a

remainder

the next higher power of two when divided by that Fermat number (since

F

n

-

1

=

2

2

n

), then that Fermat number is a

Fermat prime

.

For example,

17

=

2

2

2

+

1

is a Fermat prime, and we can see that

3

8

=

6561

, which leaves a remainder of 16 when divided by 17. The smallest Fermat number not to be a prime is 4294967297, as it is the product of 641 and 6700417, and

3

2147483648

divided by 4294967297 leaves a remainder of 10324303 rather than 4294967296.

Title

Pépin’s theorem

Canonical name

PepinsTheorem

Date of creation

2013-03-22 18:53:09

Last modified on

2013-03-22 18:53:09

Owner

PrimeFan (13766)

Last modified by

PrimeFan (13766)

Numerical id

4

Author

PrimeFan (13766)

Entry type

Theorem

Classification

msc 11A51

Synonym

Pepin’s theorem

Generated on Fri Feb 9 15:20:22 2018 by

LaTeXML
Poulet number

Poulet number

A

Poulet number

or

Sarrus number

is a

composite

integer

n

such that

2

n

≡

2

mod

n

. In other words, a base 2

pseudoprime

(thus a Poulet number that satisfies the

congruence

for other bases is a

Carmichael number

). The first few Poulet numbers are 341, 561, 645, 1105, 1387, 1729, 1905, listed in A001567 of Sloane’s OEIS.

For example, 561 is a Poulet number, since

2

561

-

2

is 75479248496430827044831091619765377
81833842440832880856752412600491248324784297704172253450355317535082936750061527
689799541169259849585265122868502865392087298790653950 and that’s

divisible

by 561. The number 561 is not prime, it has the

prime factors

3, 11, and 17.

Poulet numbers are

counterexamples

to the

Chinese hypothesis

.

References

1

Derrick Henry Lehmer, “Errata for Poulet’s table,”

Math. Comp.

25

25 (1971): 944 - 945.

Title

Poulet number

Canonical

name

PouletNumber

Date of creation

2013-03-22 18:11:12

Last modified on

2013-03-22 18:11:12

Owner

CompositeFan (12809)

Last modified by

CompositeFan (12809)

Numerical id

6

Author

CompositeFan (12809)

Entry type

Definition

Classification

msc 11A51

Synonym

Sarrus number

Generated on Fri Feb 9 15:20:27 2018 by

LaTeXML
proof of division algorithm for integers

proof of division algorithm for integers

Let

a

,

b

integers

(

b

>

0

). We want to express

a

=

b

⁢

q

+

r

for some integers

q

,

r

with

0

≤

r

<

b

and that such expression is unique.

Consider the numbers

…

,

a

-

3

⁢

b

,

a

-

2

⁢

b

,

a

-

b

,

a

,

a

+

b

,

a

+

2

⁢

b

,

a

+

3

⁢

b

,

…

From all these numbers, there has to be a smallest non

negative

one. Let it be

r

.
Since

r

=

a

-

q

⁢

b

for some

q

,

1

1

For example, if

r

=

a

+

5

⁢

b

then

q

=

-

5

.

we have

a

=

b

⁢

q

+

r

. And, if

r

≥

b

then

r

wasn’t the smallest non-negative number on the list, since the previous (equal to

r

-

b

) would also be non-negative. Thus

0

≤

r

<

b

.

So far, we have proved that we can express

a

as

b

⁢

q

+

r

for some pair of integers

q

,

r

such that

0

≤

r

<

b

. Now we will prove the uniqueness of such expression.

Let

q

′

and

r

′

another pair of integers holding

a

=

b

⁢

q

′

+

r

′

and

0

≤

r

′

<

b

. Suppose

r

≠

r

′

. Since

r

′

=

a

-

b

⁢

q

′

is a number on the list, cannot be smaller or equal than

r

and thus

r

<

r

′

. Notice that

0

<

r

′

-

r

=

(

a

-

b

⁢

q

′

)

-

(

a

-

b

⁢

q

)

=

b

⁢

(

q

-

q

′

)

so

b

divides

r

′

-

r

which is impossible since

0

<

r

′

-

r

<

b

. We conclude that

r

′

=

r

.
Finally, if

r

=

r

′

then

a

-

b

⁢

q

=

a

-

b

⁢

q

′

and therefore

q

=

q

′

. This concludes the proof of the uniqueness part.

Title

proof of division algorithm for integers

Canonical name

ProofOfDivisionAlgorithmForIntegers

Date of creation

2013-03-22 13:01:11

Last modified on

2013-03-22 13:01:11

Owner

drini (3)

Last modified by

drini (3)

Numerical id

4

Author

drini (3)

Entry type

Proof

Classification

msc 11A51

Generated on Fri Feb 9 15:20:29 2018 by

LaTeXML