# Arithmetic mean of positive integers less than an integer $N$ and co-prime with $N$.

Let $N>1$ be a positive integer. What will be the Arithmetic mean of positive integers less than $N$ and co-prime with $N$?

Getting no idea how to proceed!

-

(The way the problem reads at this time is "What will be the Arithmetic mean of positive integers less than $N$ and co-prime with $N$?" (I mention this in case there was some other version of the question and it got edited.))

$n$ is coprime to $N$ if and only if $N-n$ is coprime to $N$.

The average of $n$ and $N-n$ is $N/2$.

The average of the averages of all such cases is the average of a bunch of numbers each equal to $N/2$.

The average of all numbers in $\{1,\dots,N\}$ that are coprime to $N$ is therefore $N/2$.

Later edit: Here's an example. The numbers in $\{1,\dots,20\}$ that are coprime to $20$ are $1,3,7,9,11,13,17,19$.

They come in these pairs: \begin{align} 1, & 19 \text{ (The average of these two is $10$.)} \\ 3, & 17 \text{ (The average of these two is $10$.)} \\ 7, & 13 \text{ (The average of these two is $10$.)} \\ 9, & 11 \text{ (The average of these two is $10$.)} \end{align} Now take the average of all those $10$s. The average is $10$.

-

HINT:

As $(a,n)=(n-a,n),$

Let $$S=\sum_{1\le a\le n,(a,n)=1}a,$$

then $$S=\sum_{1\le a\le n,(a,n)=1}(n-a)$$

$$\implies2S=\phi(n)(a+n-a)=n\phi(n)$$ where $\phi(n)$ is the Euler Totient function, the number of positive integers $<n$ and co-prime to $n$

The Arithmetic mean will be $\frac S{\phi(n)}$

-
It looks to me as if you've made the problem far more complicated than it is and your answer is wrong. The way the problem reads at this time is "What will be the Arithmetic mean of positive integers less than $N$ and co-prime with $N$?" (I mention this in case you read some other version of the question and it got edited.) –  Michael Hardy Jul 25 '13 at 15:51
@MichaelHardy, what is wrong here? I just changed the case of $N$ from upper to lower? Here the mean will be $\frac{n\phi(n)}{2\phi(n)}=\frac n2$ –  lab bhattacharjee Jul 25 '13 at 15:53
See my answer. You've made it far more complicated than it is. –  Michael Hardy Jul 25 '13 at 15:54
@MichaelHardy, but what is wrong here???? –  lab bhattacharjee Jul 25 '13 at 15:55
To be even more clear - he counts each pair $(a, n-a)$ twice. Once for $a,$ once for $(n-a).$ This gives the total count of $\phi(n).$ That's why he has $2S$ instead of just $S.$ Regardless, this discussion wouldn't have arisen had lab written his answer in a less confusing manner. I've already up-voted yours and just didn't want people to incorrectly assume this answer is incorrect. –  lyj Jul 25 '13 at 16:22