calendarBack
Quant

/

Numbers

/

Factors & Remainders
ALL MODULES

CAT 2025 Lesson : Factors & Remainders - Euler & Fermat

bookmarked

4. Euler's Totient

Euler's Totient of a number is a function that provides a count of the natural numbers less than the number that would form a co-prime pair with it.

ϕ(n)\phi (n) is the function that represents the Euler's totient for the number nn.

If the prime factors of
nn are x1,x2,x3,...x_1, x_2, x_3, ...

ϕ(n)\bm{ \phi (n)} = n×(11x1)×(11x2)×(11x3)×... n \times \left(1 - \dfrac{1}{x_1}\right) \times \left(1 - \dfrac{1}{x_2}\right) \times \left(1 - \dfrac{1}{x_3}\right) \times ...

Example 23

How many natural numbers less than 2424 are co-prime with 2424?

Solution

24×23×3 24 \times 2^3 \times 3

\therefore The prime factors of 2424 are 22 and 33.

ϕ(24)= \phi (24) = 24×(112)×(113) 24 \times \left(1 - \dfrac{1}{2}\right) \times \left(1 - \dfrac{1}{3}\right)

=24×12×23=8= 24 \times \dfrac{1}{2} \times \dfrac{2}{3} = 8

Number of co-primes
=8= 8

Answer:
88

Note: The co-primes of
2424 that are less than it are 11, 55, 77, 1111, 1313, 1717, 1919 and 2323.

4.1 Fermat's Little Theorem of Remainders

For any given number
nn and divisor dd, if
(
11) nn and dd are co-prime, and
(
22) ϕ(d)\phi(d) is the Euler's totient of dd

Rem(nϕ(d)d)=1 \mathrm{Rem} \left(\dfrac{n^{\phi(d)}}{d}\right) = 1

Example 24

What is the remainder when 79198379^{1983} is divided by 1212?

Solution

We first reduce the base of 7979, applying the exponent rule.

Rem(79198312)=Rem((72+7)198312)=Rem(7198312)\mathrm{Rem} \left(\dfrac{79^{1983}}{12}\right) = \mathrm{Rem} \left(\dfrac{(72 + 7)^{1983}}{12}\right) = \mathrm{Rem} \left(\dfrac{7^{1983}}{12}\right)

77 and 1212 are co-prime. \therefore We can now reduce the power by applying Fermat's little theorem.

ϕ(12)\phi (12) = 12×(112)×(113)=4 12 \times \left(1 - \dfrac{1}{2}\right) \times \left(1 - \dfrac{1}{3}\right) = 4

Fermat's little theorem states
Rem(7412)=1\mathrm{Rem} \left(\dfrac{7^4}{12}\right) = 1

Rem(7198312)=\mathrm{Rem} \left(\dfrac{7^{1983}}{12}\right) = Rem((74)495×7312)=\mathrm{Rem} \left(\dfrac{(7^4)^{495} \times 7^3}{12}\right) = Rem(1495×34312)=7\mathrm{Rem} \left(\dfrac{1^{495} \times 343}{12}\right) = 7

Alternatively

When the base and the divisor are co-prime, you can directly apply the following to improve your speed:

1) Exponent Rule: In the base, write the remainder when base is divided by the divisor
2) Fermat's Theorem: In the power, write the remainder when the power is divided by the
ϕ\phi(divisor).

Rem(7912)=7\mathrm{Rem} \left(\dfrac{79}{12}\right) = 7 ; Rem(19834)=3\mathrm{Rem} \left(\dfrac{1983}{4}\right) = 3

\therefore Rem((79)198312)=Rem(7312)=7\mathrm{Rem} \left(\dfrac{(79)^{1983}}{12}\right) = \mathrm{Rem} \left(\dfrac{7^3}{12}\right) = 7

Answer:
77

Example 25

What is the remainder when 434743^{47} is divided by 2323?

Solution

4343 and 2323 are co-prime. ϕ(23)=\phi (23) = 23×(1123)=2223 \times \left(1 - \dfrac{1}{23}\right) = 22

Applying Fermat's little theorem,

we get
Rem((43)2223)=1\mathrm{Rem} \left(\dfrac{(43)^{22}}{23}\right) = 1

Rem((43)4723)=Rem(((43)47)2×(43)323)=Rem((43)323)\mathrm{Rem} \left(\dfrac{(43)^{47}}{23}\right) = \mathrm{Rem} \left(\dfrac{((43)^{47})^2 \times (43)^3}{23}\right) = \mathrm{Rem} \left(\dfrac{(43)^3}{23}\right)

=
Rem((433)323)=Rem((3)323)=Rem(2723)\mathrm{Rem} \left(\dfrac{(43 - 3)^3}{23}\right) = \mathrm{Rem} \left(\dfrac{(- 3)^3}{23}\right) = \mathrm{Rem} \left(\dfrac{- 27}{23}\right)

The remainder is unchanged when a multiple of the divisor is added to the dividend.

\therefore Rem((27+46)23)=19\mathrm{Rem} \left(\dfrac{(- 27 + 46)}{23}\right) = 19

Answer:
1919

5. Chinese Remainder

If the numerator and denominator are not co-prime, then Fermat's Little Theorem cannot be directly applied.

The following steps are then followed,
1) The divisor is prime factorised
22) The remainders when the number is divided by each of the prime factors (with their respective powers) is found.
33) The number is expressed in dq+rdq + r for the different divisors to find the common remainder.

Example 26

What is the remainder when 250340250^{340} is divided by 4444?

Solution

44=22×11 44 = 2^2 \times 11

222^2 perfectly divides 250340250^{340}Rem((250)34022)=0\mathrm{Rem} \left(\dfrac{(250)^{340}}{2^2}\right) = 0

\therefore Where aa is an integer, 250340=4a+0\bm{250^{340} = 4a + 0} \longrightarrow(11)

Rem((250)34011)=Rem((242+8)34011)=Rem((8)34011)\mathrm{Rem} \left(\dfrac{(250)^{340}}{11}\right) = \mathrm{Rem} \left(\dfrac{(242 + 8)^{340}}{11}\right) = \mathrm{Rem} \left(\dfrac{(8)^{340}}{11}\right)

ϕ(11)=11×(1111)=10\phi(11) = 11 \times \left(1 - \dfrac{1}{11}\right) = 10

\therefore Rem(834011)=Rem((810)3411)=1\mathrm{Rem} \left(\dfrac{8^{340}}{11}\right) = \mathrm{Rem} \left(\dfrac{(8^{10})^{34}}{11}\right) = 1

\therefore Where bb is an integer, 250340=11b+1\bm{250^{340} = 11b + 1} \longrightarrow(22)

Equating (
11) and (22),

4a+0=11b+14a + 0 = 11b + 1

a=11b+14a = \dfrac{11b + 1}{4}

bb = 11 satisfies. Substituting in (22),

Remainder =
11×1+1=1211 \times 1 + 1 = 12

Answer:
1212

Want to read the full content

Unlock this content & enjoy all the features of the platform

Subscribe Now arrow-right
videovideo-lock