5
$\begingroup$

I am trying to find the phi(18). Using an online calculator, it says it is 6 but im getting four.
The method I am using is by breaking 18 down into primes and then multiplying the phi(primes)

$$=\varphi (18)$$ $$=\varphi (3) \cdot \varphi(3) \cdot \varphi(2)$$ $$= 2 \cdot 2 \cdot 1$$ $$= 4$$

$\endgroup$
  • 7
    $\begingroup$ $\varphi(3^2) \ne \varphi(3) \cdot \varphi(3)$. $\endgroup$ – user61527 Mar 4 '14 at 3:39
  • 2
    $\begingroup$ If $p$ is prime, then $\varphi(p^k)=p^k-p^{k-1}$. This is because there are $p^k$ numbers between $0$ and $p^k-1$. Of these, $p^{k-1}$ are multiples of $p$, and the rest are relatively prime to $p$. $\endgroup$ – André Nicolas Mar 4 '14 at 3:44
  • $\begingroup$ This question is similar: math.stackexchange.com/questions/79520/… $\endgroup$ – Martin Sleziak Mar 4 '14 at 9:10
4
$\begingroup$

Remember that you need to determine the prime factorization of $18$. That is, $18 = 3^2 \cdot 2$. Since $18 = 3^2 \cdot 2$, we have

$$\begin{aligned} \varphi(18) = \varphi(3^2) \cdot \varphi(2) &= (3^2 - 3)(2 - 1) = 6 \end{aligned}$$

So in general, if $k = p_1^{n_1}p_2^{n_2}\cdots p_s^{n_s}$, then we have

$$\varphi(k) = \varphi(p_1^{n_1})\varphi(p_2^{n_2})\cdots \varphi(p_s^{n_s}) = (p_1^{n_1} - p_1^{n_1 - 1})(p_2^{n_2} - p_2^{n_2 - 1})\cdots (p_s^{n_s} - p_s^{n_s - 1})$$

$\endgroup$
  • $\begingroup$ thanks a lot! makes sense! $\endgroup$ – Krimson Mar 4 '14 at 3:58
5
$\begingroup$

The phi function is multiplicative, but not completely multiplicative: Thus if $a, b$ are relatively prime, we have that

$$\varphi(ab) = \varphi(a) \varphi(b)$$

but this is not necessarily true if $a$ and $b$ have a common prime factor. In particular, it's true that

$$\varphi(18) = \varphi(2) \varphi(9)$$

but not $\varphi(2) \varphi(3)^2$.

$\endgroup$
2
$\begingroup$

Your multiplicative property is not necessarily true when the two numbers you're multiplying share a common factor. Here's the general formula: given $N = p_1^{q_1}p_2^{q_2}\cdots p_n^{q_n}$ (where $p_1, \ldots, p_n$ are distinct primes), we can find that $$ \phi(N) = N\left(1-\frac{1}{p_1}\right)\left(1-\frac{1}{p_2}\right)\cdots\left(1-\frac{1}{p_n}\right) $$

In the case of $18 = 2 \cdot 3^2$, this gives: $$ \phi(18) = 18\left(\frac{1}{2}\right)\left(\frac{2}{3}\right) = 6 $$ I leave the proof of this as an exercise (hint: consider (and enumerate) those numbers divisible by $p_1, p_2, \ldots, p_n$).

$\endgroup$
0
$\begingroup$

By definition, $\varphi(18)$ is the number of elements in the set $$\{n : 1\leq n \leq 17, \text{ with } \gcd(n,18)=1\}=\{1,5,7,11,13,17\}.$$ Thus, $\varphi(18)=6$. Similarly, $\varphi(9)$ is the number of elements in the set $$\{n : 1\leq n \leq 8, \text{ with } \gcd(n,9)=1\}=\{1,2,4,5,7,8\},$$ so $\varphi(9)=6$, and not $4$.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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