Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a homework to hand in and they asked this question. I don't know if I'm supposed to count 1 as a prime to that number or not.

In my case $p=3947$, so I count 3945 numbers fitting that criteria since $p$ is prime.

Is this correct ?


share|cite|improve this question
I would definitely count 1, since the normal definition if "prime to ..." is that the greatest common factor should be 1. – Old John Nov 15 '12 at 15:16
There are not 3945 primes lower than $3947$. – Arthur Nov 15 '12 at 15:21
I understand that he is not counting primes below $p$, but rather numbers below $p$ which are "prime to $p$", i.e. relatively prime to $p$. – Old John Nov 15 '12 at 15:30
@JonasKibelbek : I edited the question to be clearer. You're right that it's a different question. – BrainOverfl0w Nov 15 '12 at 15:35
$p=3947$ is prime. Therefore the answer is $\phi(p)=p-1=3946$. – PAD Nov 15 '12 at 15:52
up vote 1 down vote accepted

The correct terminology is 'co-prime' with p. And there's a known formula for it. Euler's totient. look at

share|cite|improve this answer
Thanks, in short $3947$ is the answer I was looking for. Euler's totient function clarified my confusion. – BrainOverfl0w Nov 15 '12 at 16:07
If you take the average of your 2 answers then you are correct! – PAD Nov 15 '12 at 16:25

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.