Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Calculating Euler phi function

  1. Nov 18, 2008 #1
    How do i comput the euler phi function of a large interger?
    i know that if p is prime then phi(p)=p-1 and i've found a formula for computing non primes but i dont know how to implement in something like Matlab.
    Does anyone know how?
  2. jcsd
  3. Nov 19, 2008 #2
    AFAIK, computing the Euler phi function requires you to know the prime factorization of the input. Unless you can find it, there's not much you can do.
  4. Nov 25, 2008 #3
    Yes i know the factorisation problem is hard. Im workin with RSA encryption so we know two large primes, the product of which is N this is what i want to do euler phi on.
    Since N is the product of two primes (p and q) is phi(N) simply (p-1)(q-1)?
  5. Nov 25, 2008 #4


    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

Share this great discussion with others via Reddit, Google+, Twitter, or Facebook