5

Noticed these two patterns while playing with Euler's totient function $\varphi(n)$ and primes:

$$\text{For } n \text{ even}, \text{ if } \varphi(n) = \frac{n-2}{2} \text{ then } \frac{n}{2} \text{ is prime.}$$


$$\text{For } n \text{ odd}, \text{ if } \varphi(n) = \frac{2n-6}{3} \text{ then } \frac{n}{3} \text{ is prime.}$$

Question

Are those known patterns? I searched but couldn't find anything similar.

vengy
  • 2,421
  • 2
    @Sil, since $\varphi(n)$ is an integer and $\varphi(n)=\frac {2n-6}3$ (assuming the equality), we must have $3,|,n$ if the equality holds. – lulu Sep 23 '23 at 15:45
  • @lulu Oh yes, good point – Sil Sep 23 '23 at 15:46
  • Can those claims be proven or did you only checked some range ? – Peter Sep 23 '23 at 18:18
  • 1
    Tried various combinations and wrote a C program to look for any patterns. Got lucky, so I'm not aware of any rigorous proofs. – vengy Sep 23 '23 at 18:58
  • 4
    Your patterns are coming from this : for primes $p,q$, $n=pq$, $\varphi(pq)=(p-1)(q-1)$, because $\varphi(p)=p-1$ and $\varphi(n)$ is multiplicative. – MyMolecules Sep 23 '23 at 19:00
  • I don't know if these are known but they follow simply from the formula of totient function (e.g. for the first case assume $n=2^a b$ with $a\geq 1$ and $2\nmid b$ and apply multiplicativity to get $\varphi(n)=\varphi(2^a)\varphi(b)$, you will find out that necessarily $a=1$ and $\varphi(b)=b-1$). – Sil Sep 23 '23 at 23:04

1 Answers1

4

We can prove both and more by generalizing slightly,

Theorem: Suppose $\varphi(n)=\frac{(p-1)n}{p}-(p-1)$ for some prime $p$. Then $p$ divides $n$ and $\frac{n}{p}$ is prime.

Proof: First we see that $p$ divides $n$ because $p(\varphi(n)+p-1)=(p-1)n$ and $p$ does not divide $p-1$.

Second, let $n=p^km$ with $p$ not dividing the integer $m$ and $k\ge 1$.

$$\varphi(n)=\frac{(p-1)n}{p}-(p-1)$$ $$\varphi(p^km)=\frac{(p-1)p^km}{p}-(p-1)$$ By multiplicativity, $\varphi(p^km)=\varphi(p^k)\varphi(m)$, $$p^{k-1}(p-1)\varphi(m)=(p-1)p^{k-1}m-(p-1)$$ $$\varphi(m)=m-\frac{1}{p^{k-1}}$$

Now because $m-\varphi(m)=\frac{1}{p^{k-1}}$ is an integer, this forces $k=1$.

$$\varphi(m)=m-1$$

This means $m$ is relatively prime to all $m-1$ numbers less than it, therefore $m$ is prime.

Merosity
  • 2,737