I am in process of writing essay about cryptography and math behind it. I know that φ(n)=(p-1)(q-1), but would it be true if p and q are not primes but just ordinary factors of n?
-
1http://en.wikipedia.org/wiki/Euler's_totient_function#Euler.27s_product_formula – lab bhattacharjee Dec 06 '13 at 07:59
-
It couldn't be true, could it? Because $6 \times 35 = 10 \times 21$, but $5\times 34 \ne 9 \times 20$. – TonyK Dec 06 '13 at 08:09
-
In general, $\phi(mn) = \phi(m) \phi(n) \frac{d}{\phi(d)}$ where $d=\gcd(m,n)$. See http://math.stackexchange.com/questions/114841/proof-of-a-formula-involving-eulers-totient-function. – lhf Dec 06 '13 at 10:24
3 Answers
In general,
If the integer $n\ge1$ has the prime factorization $n=p^{k_1}_1p^{k_2}_2 \cdot\cdot\cdot p^{k_r}_r$, then $$\phi(n)=n\left(1-\frac{1}{p_1}\right)\left(1-\frac{1}{p_2}\right) \cdot\cdot\cdot \left(1-\frac{1}{p_r}\right)$$.
There is a paper coming out on Rose-Hulman Institute of Technology Math Journal on Dec 15 about this function if you are interested. The latest issue is here,
http://www.rose-hulman.edu/mathjournal/v14n1.php.
You will want to wait until the 15th for the next one. The paper was written by undergrads so it should very accessible.
Update: This is the link to the above mentioned paper: http://www.rose-hulman.edu/mathjournal/archives/2013/vol14-n2/paper6/v14n2-6pd.pdf

- 1,074
- 7
- 20
-
There does not seem to be any mention of any paper on this topic at that link. – Tobias Kildetoft Dec 06 '13 at 08:41
-
As I mentioned, it is being published the 15th, it is not out yet. – ReverseFlowControl Dec 06 '13 at 08:42
-
Ahh. You might want to make it more clear that the link is not to anything about that paper then. – Tobias Kildetoft Dec 06 '13 at 08:43
-
Decompose n into prime factors- (a)^r,(b)^s,(c)^t... and use the result phi(p^x) = p^x -p^x-1.

- 73
- 4
-
If those are supposed to be the primes dividing $n$, then either this is wrong or you need to assume that $n$ is squarefree. – Tobias Kildetoft Dec 06 '13 at 08:39
-
Yes sorry decompose to n's prime powers then use phi(p^n) = p^n - p^n-1 – stevie Dec 06 '13 at 09:10
Suppose $n=p_1^{k_1}p_2^{k_2}...p_m^{k_m}$, where $p_i,i=1,...,k$ are distinct primes.
Then $\phi(n)=n(1-\frac{1}{p_1})(1-\frac{1}{p_2})\cdot...\cdot (1-\frac{1}{p_m})$.

- 1,736
- 1
- 13
- 15
-
Please consider at least defining the symbols you use. As written this is not actually correct (calling a number $p$ does not mean it is a prime, and unless specified, one might have $p_i = p_j$ for $i\neq j$). – Tobias Kildetoft Dec 06 '13 at 08:51
-
$\phi$ is the Euler totient function. It is indeed true. Proof first it is multiplicative (it is not strongly multiplicative), then calculate it for prime powers. – Marc Palm Dec 06 '13 at 09:13
-
1@MarcPalm The claim is only true if the $p_i$ are distinct primes. Just because a notation suggests this to be the case does not mean it should not be pointed out. – Tobias Kildetoft Dec 06 '13 at 10:12
-
@TobiasKildetoft An edit was made to take care of things. Thanks for pointing it out. – epsilon Dec 06 '13 at 10:43