Solving $\tau(n)+\phi(n)=n$ for $n\in\mathbb{N})_{\ge 1}$. 
Let $\tau(n)$ denote the number of divisors of a positive integer $n$,
  and let $\phi(n)$ be Euler's totient function, i.e. the number of
  positive integers less than and coprime to $n$. I'd like to find all
  $n$ such
      $$ \tau(n)+\phi(n)=n.$$



*

*The case when $n=p$ for $p\in\mathbb{P}$ is easy. We have
$\tau(n)=2$, $\phi(n)=p-1$ and the equation is equivalent to $$
   2+p-1=p+1=p,$$ which is impossible.

*The case of $n=p^k$, where $k\in\mathbb{N}_{\ge 2}$ is already more complicated. We have $\tau(p^k)=k+1$ and $\phi(p^k)=p^k(1-1/p)$, hence the equation is equivalent to
$$ k+1+p^k\left(1-\frac{1}{p}\right)=p^k,$$
which can be rearranged into 
$$ k=p^{k-1}-1=p^{k-1}-1^{k-1}=(p-1)(p^{k-2}+p^{k-3}+\ldots+1).$$
For example, for $k=2$ this is $2=p-1$, and $p=3$. It's easy to check that $n=3^2=9$ satisfies the conditions. For $k=3$, we have $3=p^2-1$, and $p=2$. Hence $n=2^3=8$. $k=4$ gives $4=p^3-1$, and unfortunately there's no solution.

*When $n=p_1\cdot p_2^k$ with $p_1,p_2$ distinct primes, we have
$\phi(p_1p_2^k)=\phi(p_1)\phi(p_2^k)$. As
$\tau(p_1p_2^{k})=2+k+1=k+3$, $\phi(p_1)=p_1-1$ and
$\phi(p_2^k)=p_2^k(1-1/p_2)$, the equation transforms into 
$$k+3+p_1-1+p_2^k\left(1-\frac{1}{p_2}\right)=p_1p_2^k,$$
which, after little bit of rearranging gives
$$ k+2+p_1+p_2^k-p_2^{k-1}=p_1p_2^k.$$
For $k=1$, this is 
$$1+2+p_1+p_2-p_2^{0}=p_1p_2, $$ or 
$$ 2+p_1+p_2=p_1p_2,$$
which does not help very much.


I have no clue about the approach to the general case. I'm not even sure my current approach is useful at all.
Any hints greatly appreciated. 

$$n-\tau(n) = \sum_{a=2}^n 1_{a \,\nmid \, n}$$
$\sum_{a=2}^n 1_{a \,\nmid \, n} = \phi(n) = 1+\sum_{a=2}^n 1_{(a,n)=1}$ means there is  exactly one $a \in [2,n]$ such that $(a,n)\ne 1$ and $a\nmid n$. 
Take a prime $p | (a,n)$. Thus $n = p d$ and for any $b = p r,r \in [2,d], (r,d)=1$ we have $(b,n)\ne 1$, $b\nmid n$ ie. $\phi(d)-1$ possibilities. Therefore $\phi(d)-1 = 1$ and $d = 3$ or $4$ or $6$
Hence $n= 3p$ or $4p$ or $6p$ and we obtain the complete list of solutions easily.
