CR - 0.1 - Number Theory and Modular Arithmetic
CR - 0.1 - Number Theory and Modular Arithmetic
IMT Lucca
➢ Introduction
➢ Prime Numbers
➢ Modular Arithmetic
➢ Logarithms
➢ Introduction
➢ Prime Numbers
➢ Modular Arithmetic
➢ Logarithms
➢ Introduction
➢ Prime Numbers
➢ Modular Arithmetic
➢ Logarithms
Euclid’s algorithm
➢ Given two natural numbers a and b,
➢ if b is zero a is the MCD.
➢ If b is different from 0, divide a by b and assign the remainder to r (a mod
b). If r = 0 then b is the MCD, otherwise let a = b and b = r and repeat the
division again.
➢ Introduction
➢ Prime Numbers
➢ Modular Arithmetic
➢ Logarithms
➢ Example:
➢ 38 ≡ 14 (mod 12) because
➢ 38 − 14 = 24, which is a multiple of 12
➢ Both 38 and 14 have the same remainder (2) if divided by 12.
➢ Properties:
➢ Reflexivity: a ≡ a (mod n)
➢ Symmetry: a ≡ b (mod n) if and only if b ≡ a (mod n)
➢ Transitivity: If a ≡ b (mod n) and b ≡ c (mod n), then a ≡ c (mod n)
➢ Euler's Theorem:
➢ Given two integers a and n that are coprime:
af(n) = 1 (mod n)
➢ f(10) = #{1,3,7,9} = 4
➢ af(10)= 34 = 81 = 1 (mod 10)
➢ Given a = 2 and n = 11,
➢ f(11) = 10
➢ af(10)= 210 = 1024 = 1 (mod 11)
➢ Introduction
➢ Prime Numbers
➢ Modular Arithmetic
➢ Logarithms
Paolo Prinetto
President of CINI
Paolo.Prinetto@polito.it
Mob. +39 335
Number 227529 &
Theory
Modular Arithmetic
43 https://cybersecnatlab.it