Module -2
Sylabus
Poisne Nwnbess Pine nbers and
plne-po wes
Pactoigation , Femat and Metserne pimes
Fetmat's theose Applieati ons ,Eulers theorei
Euleri to tient function , Applicatins. Primaliy
testing - Deteinictic algthns and Pat abilie ie
CyDÌvieibility galithr)
algoithm a Fesnat test Eeat , Sqiane oot test, Miles
Rabin test). Factorgatien - Fematt, Pactoigatio ,
Polla p-method.
Fesmt Pzimes and Mersenne Ptmes
>Fesatfones, Pise ninobens,, which be
k
e<psessed [Link]. fogin + ahene k belogS
to aredoealedFernot 'poiges
=
4
ase Feat piges
be eopsessed t a t | . Butgis
not a
potme be. so it is
nwobe. not
Fent poirhe :
’ Mess enne pmes
Pima nunbess which an be e prssd in
the - whereke z+ ase called
Messenne primes ·
-3
3|= -|
are Messanne Palmes:
Notice that 15-1 But as 19 is
prme nben it is
wnbe, nt a Mers eine prboe'
Fenats heose
Fesnat's theose Faoat'i littteheosei
Feamats f'rim ality tut)
test in
states that ay pre nuobes Pp and
a (where and p are rolativeg: pro
PP divides eaacty nto a - a
a I(od p) la (rood p)= a a
anod P) =
P-!
Rermainde ot
( )=t
x(3 = P= mot a
Omod 3 X 3
P)
pma, a
P
Pmod aPosis the nCowat
into ty
Ans:
P
he Fnd
3
ae od ven Gi
P-I
Feats AsAns:
heoses
Sesult the
Dpplications
ero eos Fetneb
th
mod 3
Trostes to sowe the Yelatio
theose espruss it in e -Posn P
So conwert the p oLdei value to eapress it In
in
T44 l 3xio)t64
oof +3 mod +3
+3xLo G4
mod 3t
+3xo C4
-
e4
mod P
+3
mad 73)xqnod 3 od 3
64)
9 9 m omod
t 433
X
mod 43
Solve:
5 mod 3
Ans : 5 I3
ieoxi)*
5 ) mot |3
mot |3
mod 13mod 3
mot
12)ot 3 x 5
mo
-[ p
p-l
od |3
a
f3
> Facto ization .
Fess ats Pactarigation
(2) Polland P-I facto nigation
OFesrnats Pactirigtion
steps ?
( ) Ard pos1ive 'integer K such Hhat
Kx K" is qratai than N(uhere is the
Nie
nummbes)Take
(22 Let Vasiadle D (KxK)
(3) Tp D i Pegeot$eare then
penbeet
to step (s)
(4 2 Else inc e n t K by liey K= k+| -Repet
step 2).
(5)Find the noot ok
ok D Let
D Sx S =p.
Then, the faclais ae
+) K-s) and (K+s) K = last Kk vadue
the -facloss he rmmbas 224+
Fersats factarigation ethod .
V2324
=Isa. 4
Ans Let, K I52 So fake
(153x: I53 = 2340q ohich is geates then
2324+
Seleot aa K which gives the neasest value
rnbes
jven
k= |53
step step 3
D= (kxK)- N K= k t |
=(153xIss) 23ÆA deconal nun be
So it is not
= ls4
penget sqjianes
D=(54x \s4) Not pefect
a
K= k+
R324t
Suare
D-(55x lss) 428 ia not K= l5G
23247
|Pentect
D log q is a pefect
1084 stp
=33 S
Facloss ae {sk nd (e-k (K-s) and
(k+)
(K-s) = (156-33) /last k wale)
= |a 3
(K+s) = (I56 ta3)
184
Facloss
123 & 184
3R41
Fastoige S04009 Fosunat
Pacloiztion method
Ans: VN
Let
N= sogoo9(given
step 3 ste 4
-40x 4oo)
g090O9
D= Not a
posect K=o
D 45q5 Not perbect KqO3
D= G400
Ponbect s4ane
D= G400
K-s = 40 3 k+s = 403+80
8&3
Factiss ane SA3 and T83
Faclsige 14|43 .
I19/43
Let K346
34S
step 2 step 3 step 4 345x3+S=1|To?5
D=5+3 Not a
lpertet squae
D-l266 Not a pebect K= 348
syare
Not a perteet K= 344
D= 2GS8 Not parbect K= 2S0
D= 335 Not a paneet K=35)
D =4058 Not a peseet
a
K 35ainal k
D= 476|
D47G) Penbat
stop S=VD =69
K +s = 352+69 = 42l
K-s 283
Faces ae 42|
(2) Pollaad p-l Method fos Fastaigation)
Steps : ly-ito)
O To faco n 2 choose n a such
that 1cd (a, n)=1 ('stat froo a=
2Evalualea Pos B =l;2,3, i upto Some
limit
Find n n
B Value
stasting B=|
Contie step O by inereentng until
the gcd esult
will 2e value othe
than | This value Le a facto
n
Compula the faetos by dividig the
n by the oLtant lacto value.
aues:1) Faclooize ql usny Pollasd p-l method.
Ans : Let a2
gcd (a, n) = gd (3, 41) 49
So, a= .
hen l,
geB-1)mad n,n
god (91ylmod
ged (1,1)
ged , qi mod 't)
god C,)
When B=
-1) mod q1,q|
= got (3,al mod 3)
=g (3;)
When B=3,
= ged 63,41 mod s3)
=gedG3, R8
ged2s
-ge4, o>gc a,o)=a
So a factrs
41÷ = l3
Ques ( Factize l402 us ing Pollasd pl
p melhod.
Ans Let a= 2
check whatth e ged (a,n= )) ko2
ged a, 403) = gd (1+o3,)
= gcd (,
So d=2 (value Pied)
a=2Vale
When B-l
ged (a - ) mod to3,l4o3
= ged , r408 ) B’ bound
-gd i4o 3, ) Value
gt Ci,
When B=
god (-)mat l403,
l4o3, 4o3
= god3, (4"3)
3|1403
=god 4o 3, 3 12
23
-g-4 R,D
Remaindes
hen B= 3, 22
J433
(oR
14o3 63
14o3 - |3s
= ged
when B=4
= 2
|677Ql5 mod l403 l4-03
gd141,14o3
=ged i402, 141)
= god14l, 134)
= ged 134
=gd , D
-g-4C, J
when B s
1463 S!
s
mod (403 &
1403
mod 403 x 2mod l40 2 mod l403
med j4o3x 2 mo l403
mod 4o3
x535 od lto2
SosSt mod 14o 3
mod |403
X 5B5 m
685x535 nod
2S|0353S od l403
444
Pristhes
metod
R 5!
mod 1403 mod I4o3t
- ( ) mod J463
= (1c479214 mod 1403,
(142) mod 146 3
mod J403
mod 14o3
AGOgG46mod l4o
444
shen, gcd
=ged
gd (+43, Ito)
(1403, 4s
=ged (13, Glo
GI uohich is a factos
2factos 14o3 23
Facloss ek |403 ae
GIX 23
= 140'
Pollad
Palgnths is a nurbes they based.
intyer Pastonyatiorn algoith InventGd
Tohn Polland in l914 TE is a
Tt Is special -papse
algitho , m
eaning ttat it is only suitable
intges with specifie
Tt is he simplest eanpleio% gelje
aton alyntho . aofivation or, the
actanyion
Aactangatog
sleme, which
mettod is
elies
the RSA enyp tim
intege faotaizatn
(io fint is
cohether,
Psimality testing embe
Painality testig::
tutig
Detäminitie algotrg Paotiilistie alyoitho s
Divisti lity gotho
Fetmat
SquarenMiles
test
Rot
Rabin
test test
Probatilistie Algetthns
O Mille- Rabin test Milles Rabin o
VAnotu wetho -
(1) Te
TA n ts even stuan felse (ie nawsker is
Cosposite)
odd wnbes d such kat
(2 Find than 1)
x n-] ( woust be greatis
( yuul to 1)
k times :
(5) Do Pollooing ste
(4) 1P (iller test(n, d =Palse
setin false ie; numbes is comporite
(4) zetn tuee (ie; numbeA is
Miles test
Sandom numbes the
(3)a) (0 Rek
sange R, n-]
Conpute mod nn
= n selin
t e (ie, numbe is fastaty psine).
Belos lop tirnes
E Do ollowing ohile d dount become
n-|
(b) TP(x==),yoisn Pale
(c) DA ==n-1), sotn tue
check
On=i3 ewhethea
Paime
oilea -Rabi
not
k= 2
Aothes Mtho.
n-|
atuans false :
comoporite
aeluann tue :'P n 1s
3
4
k:deomines acehay leel
Mlle test k ti es
itenato. Highes velue o k indicntr
ie; 2 tmes mose
accray
R,
Let So doi thefotlaig
tines Sine
d
n ie )) tine
3
=4 mod 13 = (xx)/" 3
=i64 mod 3 |3
unbes
=647 13
n
zitesation aange-,n Sinci = n l 1,
Let
mod n ie, numbes s psie
=5mmod |3 Since both teations
aeluante,
Ris neithes l taie
2) n B IL
Let k=
n-|
odd.
take the value
d x&, not
is
d.
Then,4=4 þut
Miletest
yk tmes
= & mes -
1itegtion:
Let a =4 Loopi
mod n
.mod 14
1+
2falae
nd itoatiogi Let a= 5
d mot nr
4
A3, fale
t6, which is
So heube is pie
(2) Fespat Test
Algovithun.
a Aick a tandon uobes i the dange R,n-a]
ged (a, n) =1 , Teturn) false
Pooceduse
Ezarople
(a)Nwobes to be tested is p p24421826|
Cb) choose any integ es a e
cempute thetenaindesDr
(C) Compute the emaind es: P-I
a
sReninder ob a
P
4GI4065
d) Te'em aundes , p is
composite Remaind es l , So p
is
Cornposite
Squase Root test
Pactoss of pzime nunbes
One
bee lss than qyal to sqota).
will debinitely
’ While & to sayt ND,i we Pind
a numbe
cheding
th at a factos et N,it meane
that the nnbes has mose
pame umbes
So that mbeA would not b
we do not o
find ony , Pacto
Otheaoi se1f
that implies that N has ony 2 factors | and
pzlme num b e s T a
+hus 1t is a
its els
Ezamples:
= 4
We Pactoige
Cah as
(4,4), (8, 2) Go,1)
pa it ca be obsevedhat
Bet
Sne Pactos js es s han he squase
As the unbes anbe
hus, 16 is Cormposite
factoied and the
kule is satiuli ed
N3G
J36 G
Factess : ,36 ), Go, 1s),(3,a) ,Ct,42, e,62,
a,4), (12,3 ), is,e), (3e, 1)
Tt Can be obeeved that Pactos in evet
pai is [Link] the saae
36 composite
8) Detesnoiistic Algeitho.
OPiviskliby Algothyn
Eiample.
prime
J44 q-848
he poine nmbers less than
is divisible b any hese
wobess Tt is. not, a
pzime.
poime a is 14 not is Tt
. these ot any divis1ble
by is Check
e
than less beys num Pine
ahe
|434 30| Ansi
rus
? be poine