Euler's totient and divisors count function relationship when $[(\frac{\varphi(n)}{2}+1)\cdot(\frac{\tau(n)}{2}+1)] = n$

I am studying the Euler's totient function $\varphi(n)$ and the divisors count function, $\tau(n)$, also named $d(n)$, and recently opened a question (link here) about the following condition:

(1)$\ \forall n\ge3$, if $(\frac{\varphi(n)}{2}+1)\ \mid\ n\ $ then $(\frac{\varphi(n)}{2}+1)\in \Bbb P$

I wanted to do the same exercise, but adding an extra restriction regarding the divisors count function, $\tau(n)$, and I found the following to be true in the interval $[3,29]\cup[31,10^9]$ except for only one isolated counterexample at $n=30$:

(2)$\ \forall n\in [3,29]\cup[31,10^9]$,

if $[(\frac{\varphi(n)}{2}+1)\ \mid\ n]\ \land\ [(\frac{\tau(n)}{2}+1)\ \mid\ n]\ $ then $[(\frac{\varphi(n)}{2}+1)\cdot(\frac{\tau(n)}{2}+1)] = n$

So basically when the condition (1) happens and also the restriction $(\frac{\tau(n)}{2}+1)\mid n$ happens, then both $(\frac{\varphi(n)}{2}+1)$ and $(\frac{\tau(n)}{2}+1)$ are factors of $n$ and if they are multiplied they are exactly $n$.

E.g.:

$n=21\ ,\ (\frac{\varphi(21)}{2}+1)=7 = a\ ,\ (\frac{\tau(21)}{2})+1=3 = b\ ,$ and $a\cdot b = 7\cdot3 = 21$

$n=999993\ ,\ (\frac{\varphi(999993)}{2}+1)=333331 = a\ ,\ (\frac{\tau(999993)}{2})+1=3 = b\ ,$ and $a\cdot b = 333331\cdot3 = 999993$

The only counterexample I found so far is:

$n=30\ ,\ (\frac{\varphi(30)}{2}+1)=5 = a\ ,\ (\frac{\tau(30)}{2})+1=5 = b\ ,$ and $a\cdot b = 5\cdot 5 = 25 \not= 30$

I have been reading about the properties of both the totient and the divisor count functions, but I do not understand why always seems to happen (2), except for $n=30$, so I wanted to share with you these questions:

  1. Is it trivial? can be obtained by knowing the properties of $\varphi(n)$ and $\tau(n)$?
  2. Is there another counterexample for $n\gt10^9$?

If somebody could check further would be very appreciated. Any hint or explanation about why (2) happens is very welcomed, thank you!

UPDATE 2015/05/25

Tested up to $10^9$, no counterxamples found apart from $n=30$. Here is the PARI/GP code:

eulerdiv(limitval)={
   for (n = 1, limitval,
      mytot = (eulerphi(n)/2)+1;
      mydiv = (numdiv(n)/2)+1;

      if ((n%mytot==0) && (n%mydiv==0),
         if((mytot*mydiv)==n,,print("Counterexample: "," ",n," ",mytot," ",mydiv)
         )
      )
   ) 
 }

Solution 1:

This answer proves the claim assuming that

(1)$\ \forall n\ge3$, if $(\frac{\varphi(n)}{2}+1)\ \mid\ n\ $ then $(\frac{\varphi(n)}{2}+1)\in \Bbb P$

is true, but it doesn't seem to be proven in your other post.

With (2) and (3) we denote

(2) $\left[(\frac{\varphi(n)}{2}+1)\ \mid\ n\right]\ \land\ \left[(\frac{\tau(n)}{2}+1)\ \mid\ n\right]\ $

(3) $\left[(\frac{\varphi(n)}{2}+1)\cdot(\frac{\tau(n)}{2}+1)\right] = n$

We want to know whether (2) implies (3).


We have $$\frac{\varphi(n)}{2}+1 > \frac{n}{2e^{\gamma} \log \log n + \frac{6}{\log \log n}}+1$$

$$\frac{\tau(n)}{2}+1 \leq \sqrt{n}+1$$

The first bound has been proven in Rosser and Schoenfeld (1962). The second bound is elementary.


For $n > 88$ we have

\begin{align} 2e^{\gamma} \log \log n + \frac{6}{\log \log n} &< \sqrt{n} \\ \frac{n}{2e^{\gamma} \log \log n + \frac{6}{\log \log n}} &> \frac{n}{\sqrt{n}} \\ \frac{n}{2e^{\gamma} \log \log n + \frac{6}{\log \log n}}+1 &> \frac{n}{\sqrt{n}}+1 \\ \frac{\varphi(n)}{2}+1 &> \frac{\tau(n)}{2}+1 \end{align}

Since $\frac{\varphi(n)}{2}+1$ is a prime by (1), $\frac{\varphi(n)}{2}+1$ and $\frac{\tau(n)}{2}+1$ don't have a common factor. Therefore if they statistify (2) the product of them can't be larger than $n$.


Lemma 1. For any $n >88$, if (2) is statistified, then $$\left(\frac{\tau(n)}{2}+1\right)\left(\frac{\varphi(n)}{2}+1\right)\leq n$$

$$\left(\frac{\tau(n)}{2}+1\right)<\left(\frac{\varphi(n)}{2}+1\right)$$


Now we note that if $n>88$ then $\left(\frac{\varphi(n)}{2}+1\right)$ must be the largest prime dividing $n$, otherwise $\left(\frac{\tau(n)}{2}+1\right)$ is certainly larger. A stronger claim can be made:

Lemma 2. If $n=p_1^{e_1}p_2^{e_2}p_3^{e_3}\cdots p_k^{e_k}$, and all $e_i \geq 2$, $k \geq 2$, is never statistifies (2). Choose any of the $p_k$ as $\frac{\varphi(n)}{2}+1$, and we see that $\frac{\tau(n)}{2}+1 > \frac{\varphi(n)}{2}+1$. Therefore by Lemma 1 it cannot statistify (2).


Therefore the largest prime $r$ in the prime factoristation, has exponent one. We write $$n=kr , \quad \gcd(k,r)=1, \quad \frac{\varphi(n)}{2}+1=r$$ Since $\gcd(k,r)=1$ and $\varphi$ is a multiplicative function, we have: $$\varphi(n)=\varphi(kr)=\varphi(k)\varphi(r)=\varphi(k)(r-1)$$

\begin{align*} \frac{\varphi(n)}{2}+1 &= \frac{\varphi(k)(r-1)}{2}+1=r \\ \frac{\varphi(k)(r-1)}{2} & =r-1 \\ \varphi(k) &=2 \\ k=3 &\vee k=4 \vee k=6 \end{align*}


Thus a number $n>88$ that satisfies (2) has the form $3q$, $4q$ or $6q$ for some prime $q$.

  • $n=6q$, $\varphi(n)=2(q-1)$, $\frac{\varphi(n)}{2}+1=q$, and $\frac{\tau(n)}{2}+1=5$, so it does not satisfy (2) unless $q=5$, which gives the exception $n=30$. (but we require $n>88$ anyway)
  • $n=4q$, $\varphi(n)=2(q-1)$, $\frac{\varphi(n)}{2}+1=q$, and $\frac{\tau(n)}{2}+1=4$, so it satisfies (3).

  • $n=3q$ we have $\varphi(n)=2(q-1)$ and $\frac{\varphi(n)}{2}+1=q$,
    $\frac{\tau(n)}{2}+1=3$. Therefore it satisfies (3).

Therefore all numbers $n>88$ that satisfy (2) satisfy (3).

Using the PARI/GP test in the question, it holds for all $3 \leq n \leq 29$ and $31 \leq n$.