Compute a natural number $n\geq 2$ s.t. $p\mid n \Longrightarrow p^2\nmid n$ AND $p-1\mid n \Longleftrightarrow p\mid n$ for all prime divisor p of n. Question: Compute a natural number $n\geq 2$ that satisfies:  


*

*For each prime divisor $p$ of $n$, $p^2$ does not divide $n$.  

*For each prime number $p$, $p-1$ divides $n$ if and only if $p$ divides $n$.  


I'm stuck with this one like forever.
My first intuition was to find the canonical form of such $n$, which is $\prod_{i} p_i^{\alpha_i}$, where $\alpha_i$ must be equal to  $1$ for all $i\in [1,r]$ for some $r\in\mathbb{N}$.
But it got me nowhere.
Then, I started trying to find such $n$ from the second condition. Yet again, I have no clue whatsoever.
Hence, I'm here asking for help. Any hints?
Many thanks,
D.
 A: Let $$n=p_1p_2\cdots p_k$$ where all $p_i$ are distinct and $p_i<p_j$ iff $i<j$ (this number is square-free, since $p|n$ implied $p^2\not|n$ for a prime $p$).
Now, since $p_i-1|n$, we know that either $k=1$ and $n=2$, or $k>1$ and $2|n$, so $$n=2p_2p_3\cdots p_k$$
now $p_2-1|n$ and $p_2-1$ can only have a factor $2$, since $p_2$ is the smallest prime factor of $n$ greater than $2$ - so, $p_2=3$. If $k=2$, then $n=6$. Now let $k>2$. Then $p_3-1$ can only have a factor $2$ and $3$ - so $p_3-1\in\{2,3,6\}$ or $p_3\in\{3,4,7\}$. Since $p_3$ cannot be $3$ as $p_3>p_2$, and not $4$ since it's not prime, $p_3=7$. So if $k=3$, we know $k=3$, then $n=42$. Now let $n>4$. Then $p_4-1$ can only have a factor $2$, $3$, $7$: so $$p_4-1\in\{2,3,6,7,14,21,42\}$$ so $$p_4\in\{3,4,7,8,15,22,43\}$$ Since $p_4$ needs to be a prime and $p_4>p_3$, we know $p_4=43$. So if $k=4$ then $n=1806$. Now let $k>4$. Rinse repeat. $p_5$ has divisors $2$, $3$, $7$, $43$, blah blah blah, $$p_5-1\in\{2,3,6,7,14,21,42,43,86,129,258,301,602,903,1806\}$$ so $$p_5\in\{3, 4, 7, 8, 15, 22, 43, 44, 87, 130, 259, 302, 603, 904, 1807\}$$ and all these numbers are composite or smaller or equal to $43$, thus, $p_5$ doesn't exist. Finally, we're done. We have all solutions: $$n\in\{2,6,42,1806\}$$
A: Here's a partial answer: Suppose $n$ is a solution. Then $n(n+1)$ is a solution if $n+1$ is prime, since $n+1\mid n(n+1)$ and $n\mid n(n+1)$, and the condition is clearly satisfied for all primes less than $n$. So in addition to $2$, $3$, $6$, and $42$, we also get
\begin{align*}
  42(43) = 1806 = 2\cdot 3\cdot 7\cdot 43 .
\end{align*}
This fails at the next step since $1807=13\cdot 139$. This doesn't prove that there aren't other solutions, however.
A: $6$
[And since this answer was too short, let me write some additional gibberish.]
