LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Algo for Relatively prime No. (https://www.linuxquestions.org/questions/programming-9/algo-for-relatively-prime-no-117226/)

LinuxTiro 11-17-2003 08:08 PM

Algo for Relatively prime No.
 
can neone suggest me an algo for finding a relatively prime number from two given
8digited prme numbers.
let p and q be two 8 digited prime numbers.

n=pxq
s=relatively prime to n

teval 11-17-2003 08:12 PM

Sounds like a hw problem :)
Personally.. I just want to say I'm opposed to answering this type of thing :)

LogicG8 11-17-2003 08:23 PM

That's actually pretty trivial...

Get a list of 3 different primes. Look for a prime that isn't
p or q. Since you have different 3 numbers you will always
be able to find one. Print it out.

LinuxTiro 11-17-2003 08:55 PM

Thanx.
this was not a homework problem,but part of a bigger program.

LogicG8 11-17-2003 09:00 PM

Mind if I ask what the larger programs purpose is?

LinuxTiro 11-17-2003 09:02 PM

I have to write a code for Blum Blum shub Generator


All times are GMT -5. The time now is 03:18 AM.