Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1999

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Finding a relative prime

  • To: mathgroup at
  • Subject: [mg19704] Re: Finding a relative prime
  • From: "Shazam" <gmon at>
  • Date: Sat, 11 Sep 1999 16:36:08 -0400
  • References: <7r7kal$>
  • Sender: owner-wri-mathgroup at

Can't you just pick any random prime q between 2 and p-1 and then q and p-1
are automatically relatively prime?  Or do you need to consider any
relatively prime number as potential numbers to pick?

I think I would know how to do the above but I would have to look it up
(last semester I took a cryptography course and we did things like

If you can't figure it out then let me know and I'll look it up.......

Timur Tabi <nospam_timur at> wrote in message
news:7r7kal$ckp at
> I'm using Mathematica 3.0 for the Mac, and I'm trying to figure out how
> to get it to pick a random number that is relatively prime to another
> number, p-1, where p is prime.  In other words, pick a random number k
> such that 1) k is between 2 and p-1, and 2) k is relatively prime to p-1.
> How can I do that in Mathematica 3.0?
> --
> Remove "nospam_" from my email address when replying
> Timur "too sexy for my code" Tabi, timur at
> Sent via
> Share what you know. Learn what you don't.

  • Prev by Date: Scrolling Font problem?
  • Next by Date: space disappears when printing
  • Previous by thread: Re: Finding a relative prime
  • Next by thread: Re: Re: Finding a relative prime