SlideShare a Scribd company logo
1 of 6
Download to read offline
Euler Phi
Lets talk about the problem first,
we want to know how many number is relatively prime / co-primes to N.
What's relatively prime / Co-prime ?
if gcd(x,y) == 1 , then they are x and y are co-primes.
Simply,
if 1 is the only number that can evenly divide x and y then they are
co-primes.
As example,
So, 12 and 13 are co-primes.
Our problem was,
how many numbers are there which are co-primes to N.
Means,
Lets Assume , N = 8
We can see there are 4 number co-primes with N=8.
So we are looking for a general formula to find for any N.
Euler phi function do that for us.
Suppose we are going to find the value of phi(N)
where,
Here p1 , p2 .. pk are primes
and this is actually the prime factorization of N
So for N = 24
Lets talk about the formula to find out the phi() value for any N.
formula is,
Lets try the proof of it,
Lets talk about some case,
Case 1 : N is Prime
When N is primes we can make it sure that there is no number
except 1 and itself that can divide it otherwise it cant be a prime.
So , it maintained such relation with every number less than it.
the relation is,
gcd(x,n) = 1;
So we can surely say that phi of such n is phi(n) = n-1.
When n is a prime of course.
Case 2 : When N is power of Prime
Means if we can express N as power of 1 single prime.
Like N = 8
we can write is as N = 2 x 2 x 2.
or N = 2 ^ 3
In this scenario,
phi(n) = n - (n / p);
where n = p ^ x; =======================> x is any integer,p is prime <===
HOW !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Lets take an example,
where N = 8.
So , every number which are divisble by 2 before 8 are not maintain
the realtion.
which is,
gcd(n,x) 1;
bc their gcd will be 2 or greater than 2.
Here we can see , 4 numbers are not coprimes to n.
which is exactly
n / p = 8 / 2 = 4.
so if we subtract all those numbers whose are not co-prime to N
then we could be able to find the exact value of phi(n).
in this case that is,
phi(8) = 8 - (8 / 2) = 4
so phi(8) = 4;
if we can write N like this ,
Then the number of numbers not coprime to N is ,
Which are actually divisible by P.So they cant be coprime to N.
so the final foumula for such N that can be written as a single
prime is,
Now its looks like the equation above.The general formula,
We know Phi function is multiplicative,
means,
phi(m * n) = phi(m) * phi(n).
Lets not talk about the proof of multiplicity of phi now.
Assume that is multiplicative and complete the proof.
So as we know any number can express multiplication of primes.What we
call primes factorization.
lets say,factorization of N is,
We already found out that phi of such numbers that can be expressed
as power of single prime is,
Now its look like exactly the same we written before.
You can follow the reference list below to know further.
Thank you.

More Related Content

What's hot

Predicates and quantifiers
Predicates and quantifiersPredicates and quantifiers
Predicates and quantifiersIstiak Ahmed
 
Counting, mathematical induction and discrete probability
Counting, mathematical induction and discrete probabilityCounting, mathematical induction and discrete probability
Counting, mathematical induction and discrete probabilitySURBHI SAROHA
 
21 monotone sequences x
21 monotone sequences x21 monotone sequences x
21 monotone sequences xmath266
 
Pigeonhole Principle
Pigeonhole PrinciplePigeonhole Principle
Pigeonhole Principlenielsoli
 
Sequences and summations
Sequences and summationsSequences and summations
Sequences and summationsAli Saleem
 
Mathematical Induction
Mathematical InductionMathematical Induction
Mathematical InductionEdelyn Cagas
 
Mathematical induction
Mathematical inductionMathematical induction
Mathematical inductionSman Abbasi
 
Modular arithmetic
Modular arithmeticModular arithmetic
Modular arithmeticsangeetha s
 
OPTIMAL BINARY SEARCH
OPTIMAL BINARY SEARCHOPTIMAL BINARY SEARCH
OPTIMAL BINARY SEARCHCool Guy
 
CMSC 56 | Lecture 1: Propositional Logic
CMSC 56 | Lecture 1: Propositional LogicCMSC 56 | Lecture 1: Propositional Logic
CMSC 56 | Lecture 1: Propositional Logicallyn joy calcaben
 
Asymptotic analysis
Asymptotic analysisAsymptotic analysis
Asymptotic analysisSoujanya V
 
Divisibility
DivisibilityDivisibility
Divisibilitymstf mstf
 
Chapter 5 Graphs (1).ppt
Chapter 5 Graphs (1).pptChapter 5 Graphs (1).ppt
Chapter 5 Graphs (1).pptishan743441
 
CMSC 56 | Lecture 13: Relations and their Properties
CMSC 56 | Lecture 13: Relations and their PropertiesCMSC 56 | Lecture 13: Relations and their Properties
CMSC 56 | Lecture 13: Relations and their Propertiesallyn joy calcaben
 
number theory.ppt
number theory.pptnumber theory.ppt
number theory.pptShishu
 

What's hot (20)

Predicates and quantifiers
Predicates and quantifiersPredicates and quantifiers
Predicates and quantifiers
 
Counting, mathematical induction and discrete probability
Counting, mathematical induction and discrete probabilityCounting, mathematical induction and discrete probability
Counting, mathematical induction and discrete probability
 
21 monotone sequences x
21 monotone sequences x21 monotone sequences x
21 monotone sequences x
 
Pigeonhole Principle
Pigeonhole PrinciplePigeonhole Principle
Pigeonhole Principle
 
Sequences and summations
Sequences and summationsSequences and summations
Sequences and summations
 
Mathematical Induction
Mathematical InductionMathematical Induction
Mathematical Induction
 
Generating function
Generating functionGenerating function
Generating function
 
Mathematical induction
Mathematical inductionMathematical induction
Mathematical induction
 
Lecture26
Lecture26Lecture26
Lecture26
 
Set Theory
Set TheorySet Theory
Set Theory
 
Modular arithmetic
Modular arithmeticModular arithmetic
Modular arithmetic
 
OPTIMAL BINARY SEARCH
OPTIMAL BINARY SEARCHOPTIMAL BINARY SEARCH
OPTIMAL BINARY SEARCH
 
CMSC 56 | Lecture 1: Propositional Logic
CMSC 56 | Lecture 1: Propositional LogicCMSC 56 | Lecture 1: Propositional Logic
CMSC 56 | Lecture 1: Propositional Logic
 
Asymptotic analysis
Asymptotic analysisAsymptotic analysis
Asymptotic analysis
 
Divisibility
DivisibilityDivisibility
Divisibility
 
Chapter 5 Graphs (1).ppt
Chapter 5 Graphs (1).pptChapter 5 Graphs (1).ppt
Chapter 5 Graphs (1).ppt
 
CMSC 56 | Lecture 13: Relations and their Properties
CMSC 56 | Lecture 13: Relations and their PropertiesCMSC 56 | Lecture 13: Relations and their Properties
CMSC 56 | Lecture 13: Relations and their Properties
 
Chapter 4 Cyclic Groups
Chapter 4 Cyclic GroupsChapter 4 Cyclic Groups
Chapter 4 Cyclic Groups
 
number theory.ppt
number theory.pptnumber theory.ppt
number theory.ppt
 
Permutations and combinations
Permutations and combinationsPermutations and combinations
Permutations and combinations
 

Similar to Euler Phi Function Formula for Finding Numbers Relatively Prime to N

Similar to Euler Phi Function Formula for Finding Numbers Relatively Prime to N (20)

Raices primitivas
Raices primitivasRaices primitivas
Raices primitivas
 
Number theory
Number theoryNumber theory
Number theory
 
Godels First Incompleteness Theorem
Godels First Incompleteness TheoremGodels First Incompleteness Theorem
Godels First Incompleteness Theorem
 
Basics of Mathematical Cryptography
Basics of Mathematical CryptographyBasics of Mathematical Cryptography
Basics of Mathematical Cryptography
 
Ijetr011954
Ijetr011954Ijetr011954
Ijetr011954
 
Real numbers
Real numbersReal numbers
Real numbers
 
RSA final notation change2
RSA final notation change2RSA final notation change2
RSA final notation change2
 
04
0404
04
 
EULER AND FERMAT THEOREM
EULER AND FERMAT THEOREMEULER AND FERMAT THEOREM
EULER AND FERMAT THEOREM
 
AJMS_490_23.pdf
AJMS_490_23.pdfAJMS_490_23.pdf
AJMS_490_23.pdf
 
STAB52 Lecture Notes (Week 2)
STAB52 Lecture Notes (Week 2)STAB52 Lecture Notes (Week 2)
STAB52 Lecture Notes (Week 2)
 
Ch08
Ch08Ch08
Ch08
 
Ch08
Ch08Ch08
Ch08
 
Crt
CrtCrt
Crt
 
Brian Prior - Probability and gambling
Brian Prior - Probability and gamblingBrian Prior - Probability and gambling
Brian Prior - Probability and gambling
 
Sol80
Sol80Sol80
Sol80
 
Sol80
Sol80Sol80
Sol80
 
Mathematical Statistics Homework Help
Mathematical Statistics Homework HelpMathematical Statistics Homework Help
Mathematical Statistics Homework Help
 
The 2 Goldbach's Conjectures with Proof
The 2 Goldbach's Conjectures with Proof The 2 Goldbach's Conjectures with Proof
The 2 Goldbach's Conjectures with Proof
 
Maths project
Maths projectMaths project
Maths project
 

Recently uploaded

Quarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayQuarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayMakMakNepo
 
Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........LeaCamillePacle
 
ROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint PresentationROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint PresentationAadityaSharma884161
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxChelloAnnAsuncion2
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomnelietumpap1
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Planning a health career 4th Quarter.pptx
Planning a health career 4th Quarter.pptxPlanning a health career 4th Quarter.pptx
Planning a health career 4th Quarter.pptxLigayaBacuel1
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Recently uploaded (20)

Quarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayQuarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up Friday
 
Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........
 
ROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint PresentationROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint Presentation
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choom
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Planning a health career 4th Quarter.pptx
Planning a health career 4th Quarter.pptxPlanning a health career 4th Quarter.pptx
Planning a health career 4th Quarter.pptx
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 

Euler Phi Function Formula for Finding Numbers Relatively Prime to N

  • 1. Euler Phi Lets talk about the problem first, we want to know how many number is relatively prime / co-primes to N. What's relatively prime / Co-prime ? if gcd(x,y) == 1 , then they are x and y are co-primes. Simply, if 1 is the only number that can evenly divide x and y then they are co-primes. As example, So, 12 and 13 are co-primes. Our problem was, how many numbers are there which are co-primes to N. Means, Lets Assume , N = 8 We can see there are 4 number co-primes with N=8. So we are looking for a general formula to find for any N.
  • 2. Euler phi function do that for us. Suppose we are going to find the value of phi(N) where, Here p1 , p2 .. pk are primes and this is actually the prime factorization of N So for N = 24 Lets talk about the formula to find out the phi() value for any N. formula is, Lets try the proof of it, Lets talk about some case, Case 1 : N is Prime When N is primes we can make it sure that there is no number except 1 and itself that can divide it otherwise it cant be a prime. So , it maintained such relation with every number less than it. the relation is, gcd(x,n) = 1; So we can surely say that phi of such n is phi(n) = n-1. When n is a prime of course.
  • 3. Case 2 : When N is power of Prime Means if we can express N as power of 1 single prime. Like N = 8 we can write is as N = 2 x 2 x 2. or N = 2 ^ 3 In this scenario, phi(n) = n - (n / p); where n = p ^ x; =======================> x is any integer,p is prime <=== HOW !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Lets take an example, where N = 8. So , every number which are divisble by 2 before 8 are not maintain the realtion. which is, gcd(n,x) 1; bc their gcd will be 2 or greater than 2.
  • 4. Here we can see , 4 numbers are not coprimes to n. which is exactly n / p = 8 / 2 = 4. so if we subtract all those numbers whose are not co-prime to N then we could be able to find the exact value of phi(n). in this case that is, phi(8) = 8 - (8 / 2) = 4 so phi(8) = 4; if we can write N like this , Then the number of numbers not coprime to N is , Which are actually divisible by P.So they cant be coprime to N. so the final foumula for such N that can be written as a single prime is, Now its looks like the equation above.The general formula,
  • 5. We know Phi function is multiplicative, means, phi(m * n) = phi(m) * phi(n). Lets not talk about the proof of multiplicity of phi now. Assume that is multiplicative and complete the proof. So as we know any number can express multiplication of primes.What we call primes factorization. lets say,factorization of N is, We already found out that phi of such numbers that can be expressed as power of single prime is,
  • 6. Now its look like exactly the same we written before. You can follow the reference list below to know further. Thank you.